Compiles without error when the return type signature of variable doesn't match that of the generic function that it is being assigned to #5616
Labels
Fixed
A PR has been merged for this issue
In Discussion
Not yet reached consensus
Suggestion
An idea for TypeScript
Milestone
Compiling the code below:
outputs the following javascript:
I put the type signature of the variable
myIdentity
as<T>(arg: T) => string
where the return type is
string
instead ofT
(that I expect to be correct).I expected the Typescript compiler to show an error because the return types
don't match. However, the code compiled without any error.
Specs:
Mac OS X 10.11
tsc --version
outputs:message TS6029: Version 1.6.2
The text was updated successfully, but these errors were encountered: