26 lines
627 B
Plaintext
26 lines
627 B
Plaintext
|
==== tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts (3 errors) ====
|
||
|
|
||
|
var obj1: {};
|
||
|
|
||
|
obj1.length;
|
||
|
~~~~~~
|
||
|
!!! Property 'length' does not exist on type '{}'.
|
||
|
|
||
|
|
||
|
|
||
|
var obj2: Object;
|
||
|
|
||
|
obj2.length;
|
||
|
~~~~~~
|
||
|
!!! Property 'length' does not exist on type 'Object'.
|
||
|
|
||
|
|
||
|
|
||
|
function concat<T>(x: T, y: T): T { return null; }
|
||
|
|
||
|
var result = concat(1, "");
|
||
|
|
||
|
var elementCount = result.length; // would like to get an error by now
|
||
|
~~~~~~
|
||
|
!!! Property 'length' does not exist on type '{}'.
|
||
|
|