32 lines
1.3 KiB
Plaintext
32 lines
1.3 KiB
Plaintext
tests/cases/compiler/staticMemberExportAccess.ts(14,35): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
|
|
tests/cases/compiler/staticMemberExportAccess.ts(17,18): error TS2339: Property 'bar' does not exist on type 'Sammy'.
|
|
tests/cases/compiler/staticMemberExportAccess.ts(18,18): error TS2339: Property 'x' does not exist on type 'Sammy'.
|
|
|
|
|
|
==== tests/cases/compiler/staticMemberExportAccess.ts (3 errors) ====
|
|
class Sammy {
|
|
foo() { return "hi"; }
|
|
static bar() {
|
|
return -1;
|
|
}
|
|
}
|
|
module Sammy {
|
|
export var x = 1;
|
|
}
|
|
interface JQueryStatic {
|
|
sammy: Sammy; // class instance
|
|
}
|
|
var $: JQueryStatic;
|
|
var instanceOfClassSammy: Sammy = new $.sammy(); // should be error
|
|
~~~~~~~~~~~~~
|
|
!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
|
|
var r1 = instanceOfClassSammy.foo(); // r1 is string
|
|
var r2 = $.sammy.foo();
|
|
var r3 = $.sammy.bar(); // error
|
|
~~~
|
|
!!! error TS2339: Property 'bar' does not exist on type 'Sammy'.
|
|
var r4 = $.sammy.x; // error
|
|
~
|
|
!!! error TS2339: Property 'x' does not exist on type 'Sammy'.
|
|
|
|
Sammy.bar(); |