Union type method parameters in base class accepts incompatible types in subclass overrides #19832
Labels
Working as Intended
The behavior described is the intended behavior; this is not a bug
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: