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
TypeScript Version:
1.9.0-dev / nightly (1.9.0-dev.20160311)
Code
class ModelA<T extends BaseData> { public prop : T; public constructor($prop : T) { } public Foo<TData, TModel>( $fn1 : ($x : T) => TData, $fn2 : ($x : TData) => TModel) { } public Foo1<TData, TModel extends ModelA<any>>( $fn1 : ($x : T) => TData, $fn2 : ($x : TData) => TModel) { } public Foo2<TData extends BaseData, TModel extends ModelA<TData>>( $fn1 : ($x : T) => TData, $fn2 : ($x : TData) => TModel) { } } class ModelB extends ModelA<Data> { } class BaseData { public a : string; } class Data extends BaseData { public b : Data; } class P { public static Run() { var modelA = new ModelA<Data>(new Data()); modelA.Foo(x1 => x1.b, x2 => new ModelB(x2)); modelA.Foo1(x1 => x1.b, x2 => new ModelB(x2)); // Why is this not working??? inferred type for x2 : BaseData modelA.Foo2(x1 => x1.b, x2 => new ModelB(x2)); // Error } }
Expected behavior: modelA.Foo2 call should infer the type.
Actual behavior: Is not inferring the actual type.
The text was updated successfully, but these errors were encountered:
looks like #7234
Sorry, something went wrong.
indeed a duplicate of #7234
No branches or pull requests
TypeScript Version:
1.9.0-dev / nightly (1.9.0-dev.20160311)
Code
Expected behavior:
modelA.Foo2 call should infer the type.
Actual behavior:
Is not inferring the actual type.
The text was updated successfully, but these errors were encountered: