TypeScript/tests/baselines/reference/nonContextuallyTypedLogicalOr.errors.txt
2014-09-11 16:11:08 -07:00

19 lines
556 B
Plaintext

==== tests/cases/compiler/nonContextuallyTypedLogicalOr.ts (1 errors) ====
interface Contextual {
dummy;
p?: number;
}
interface Ellement {
dummy;
p: any;
}
var c: Contextual;
var e: Ellement;
// This should error. Even though we are contextually typing e with Contextual, the RHS still
// needs to be a supertype of the LHS to win as the best common type.
(c || e).dummy;
~~~~~
!!! error TS2339: Property 'dummy' does not exist on type '{}'.