-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
DuplicateAn existing issue was already createdAn existing issue was already created
Description
TypeScript Version: 2.2.2
Code
class A<T> {
foo: T;
}
class B extends A<'bar'> {
foo = 'bar';
}
workaround:
class A<T> {
foo: T;
}
class B extends A<'bar'> {
foo = 'bar' as 'bar';
}
Expected behavior:
No Error;
Actual behavior:
Type string is not assignable to type 'bar';
I don't know if this behavior is intended.
I think type inference should be more accurate in this case to make programmers not to write as sometype
once again.
Metadata
Metadata
Assignees
Labels
DuplicateAn existing issue was already createdAn existing issue was already created