TypeScript Version: 3.0.0-dev.20200312
Search Terms:
Code
export interface Supervisor<N extends string, P = undefined, R = P, S = undefined> { constructor: typeof Supervisor; } export abstract class Supervisor<N extends string, P = undefined, R = P, S = undefined> { constructor() { if (this.constructor === Supervisor) this.id; } public id = 0; public abstract call(name: N | ('' extends N ? undefined | ((names: Iterable<N>) => Iterable<N>) : never), param: P, timeout?: number): Promise<R>; }
Expected behavior: pass Actual behavior: Property 'id' does not exist on type 'never'.(2339) Playground Link: http://www.typescriptlang.org/play/index.html?ts=3.9.0-dev.20200312&ssl=1&ssc=1&pln=10&pc=2#code/KYDwDg9gTgLgBASwHY2FAZgQwMbDgZQFcw0A3BAZ2gB4A5OUVJAEwrgpimQHMAaOAApwAvHEItg6ZMGb8ASiMH98i8c0nTmAPjgBvAFBw42CEg5RC2GNABccGAE8SEdAWJlK0ANz6AvvtBIWDhMACNzHHhsABtMCjYiEihyKig6BhAmVnZOHn4hUTUNJBl5RQFlVQkpEu09Q2NTc0trKAAKAEp6oyMEVzaYAAtKADoTM04W6BFhUUSPVK6h0YRmHyN-IzBCUOiEbERmRQAGdbht3f2Q8M5I40xo6LakTABbYDt6AB84NoByP4ZLJsegAfjE1U0cB+bWeb2AFDsAElUFAwtFgHQtF1hDoUWh0ZjaNi4HYSqQ0B1+GBMGjXnYKvYEO8IIQYKCyYRXqFKQyoBBXpRMXItD5fEA
Related Issues:
Simplified a bit:
interface SomeClass<N> { constructor: typeof SomeClass; } abstract class SomeClass<N> { constructor() { if (this.constructor === SomeClass) this.id; } public id = 0; public abstract foo(name: ('' extends N ? undefined: null)): any; }
Seems to be appearing after #32774
Activity
RyanCavanaugh commentedon Mar 17, 2020
Simplified a bit:
hikarino-my commentedon Mar 24, 2020
Seems to be appearing after #32774