34 lines
No EOL
881 B
Text
34 lines
No EOL
881 B
Text
==== tests/cases/compiler/multiLineErrors.ts (2 errors) ====
|
|
var t = 32;
|
|
|
|
function noReturn(): {
|
|
~
|
|
n: string;
|
|
~~~~~~~~~~~~~~
|
|
y: number;
|
|
~~~~~~~~~~~~~~
|
|
}
|
|
~
|
|
!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
|
|
{
|
|
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'.
|
|
|