2014-10-28 08:28:59 +01:00
|
|
|
tests/cases/compiler/noImplicitAnyInCastExpression.ts(16,2): error TS2352: Neither type '{ c: null; }' nor type 'IFoo' is assignable to the other.
|
2014-09-12 22:35:07 +02:00
|
|
|
Property 'a' is missing in type '{ c: null; }'.
|
|
|
|
|
|
|
|
|
2014-09-06 01:41:37 +02:00
|
|
|
==== tests/cases/compiler/noImplicitAnyInCastExpression.ts (1 errors) ====
|
|
|
|
|
|
|
|
// verify no noImplictAny errors reported with cast expression
|
|
|
|
|
|
|
|
interface IFoo {
|
|
|
|
a: number;
|
|
|
|
b: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Expr type not assignable to target type
|
|
|
|
(<IFoo>{ a: null });
|
|
|
|
|
2014-09-08 21:08:15 +02:00
|
|
|
// Expr type assignable to target type
|
2014-09-06 01:41:37 +02:00
|
|
|
(<IFoo>{ a: 2, b: undefined });
|
|
|
|
|
2014-09-08 21:08:15 +02:00
|
|
|
// Neither types is assignable to each other
|
2014-09-06 01:41:37 +02:00
|
|
|
(<IFoo>{ c: null });
|
|
|
|
~~~~~~~~~~~~~~~~~
|
2014-10-28 08:28:59 +01:00
|
|
|
!!! error TS2352: Neither type '{ c: null; }' nor type 'IFoo' is assignable to the other.
|
|
|
|
!!! error TS2352: Property 'a' is missing in type '{ c: null; }'.
|