2014-07-19 00:19:23 +02:00
|
|
|
==== tests/cases/compiler/multiLineErrors.ts (2 errors) ====
|
2014-07-13 01:04:16 +02:00
|
|
|
var t = 32;
|
|
|
|
|
|
|
|
function noReturn(): {
|
2014-07-19 00:19:23 +02:00
|
|
|
~
|
2014-07-13 01:04:16 +02:00
|
|
|
n: string;
|
2014-07-19 00:19:23 +02:00
|
|
|
~~~~~~~~~~~~~~
|
2014-07-13 01:04:16 +02:00
|
|
|
y: number;
|
2014-07-19 00:19:23 +02:00
|
|
|
~~~~~~~~~~~~~~
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|
2014-07-19 00:19:23 +02:00
|
|
|
~
|
2014-07-21 20:36:29 +02:00
|
|
|
!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
|
2014-07-13 01:04:16 +02:00
|
|
|
{
|
|
|
|
var x = 4;
|
|
|
|
var y = 10;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface A1 {
|
|
|
|
x: { y: number; };
|
|
|
|
}
|
|
|
|
interface A2 {
|
|
|
|
x: { y: string; };
|
|
|
|
}
|
|
|
|
|
|
|
|
var t1: A1;
|
|
|
|
var t2: A2;
|
|
|
|
t1 = t2;
|
|
|
|
~~
|
|
|
|
!!! Type 'A2' is not assignable to type 'A1':
|
|
|
|
!!! Types of property 'x' are incompatible:
|
|
|
|
!!! Type '{ y: string; }' is not assignable to type '{ y: number; }':
|
|
|
|
!!! Types of property 'y' are incompatible:
|
|
|
|
!!! Type 'string' is not assignable to type 'number'.
|
|
|
|
|