mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-09 07:55:10 -05:00
Test: extending from any
This commit is contained in:
11
tests/cases/compiler/extendFromAny.ts
Normal file
11
tests/cases/compiler/extendFromAny.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
declare var Base: any;
|
||||
class C extends Base {
|
||||
known = 1;
|
||||
static sknown = 2;
|
||||
}
|
||||
|
||||
let c = new C();
|
||||
c.known.length; // error, 'real' has no 'length' property
|
||||
C.sknown.length; // error, 'sreal' has no 'length' property
|
||||
c.unknown.length; // ok, fake: any
|
||||
C.sunknown.length; // ok: sfake: any
|
||||
Reference in New Issue
Block a user