You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using union types in base class method declarations allows override functions that only declare one of the union member types. This produces code that crashes at runtime, even with --strict.
Aha, I had missed the part where --strictFunctionTypes does not apply to methods. I take it I should stay away from inheritance if I want contravariant parameter checking then.
Using union types in base class method declarations allows override functions that only declare one of the union member types. This produces code that crashes at runtime, even with --strict.
TypeScript Version: 2.7.0-dev.20171108
Code
Expected behavior:
Should not compile.
Actual behavior:
Compiles and crashes at runtime.
The text was updated successfully, but these errors were encountered: