We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
keyof this
cc @ahejlsberg
TypeScript Version: 2.7.0-dev.20180210
Search Terms:
Code
type OldDiff<T extends string, U extends string> = ( & { [P in T]: P; } & { [P in U]: never; } & { [x: string]: never; } )[T]; type NewDiff<T, U> = T extends U ? never : T; interface A { a: 'a'; } interface B1 extends A { b: 'b'; c: OldDiff<keyof this, keyof A>; } interface B2 extends A { b: 'b'; c: NewDiff<keyof this, keyof A>; } type c1 = B1['c']; // 'c' | 'b' type c2 = B2['c']; // 'c' | 'a' | 'b'
Expected behavior:
c2 is 'c' | 'b'.
c2
'c' | 'b'
Actual behavior:
c2 is 'c' | 'a' | 'b'.
'c' | 'a' | 'b'
Playground Link:
Related Issues:
The text was updated successfully, but these errors were encountered:
@ahejlsberg Is this not a bug?
Sorry, something went wrong.
@falsandtru Don't know yet, haven't had time to look.
I see.
ahejlsberg
No branches or pull requests
cc @ahejlsberg
TypeScript Version: 2.7.0-dev.20180210
Search Terms:
Code
Expected behavior:
c2
is'c' | 'b'
.Actual behavior:
c2
is'c' | 'a' | 'b'
.Playground Link:
Related Issues:
The text was updated successfully, but these errors were encountered: