2014-09-12 22:35:07 +02:00
|
|
|
tests/cases/compiler/exportAssignmentOfDeclaredExternalModule_1.ts(3,13): error TS2304: Cannot find name 'Sammy'.
|
|
|
|
tests/cases/compiler/exportAssignmentOfDeclaredExternalModule_1.ts(4,9): error TS2304: Cannot find name 'Sammy'.
|
|
|
|
|
|
|
|
|
2014-07-13 01:04:16 +02:00
|
|
|
==== tests/cases/compiler/exportAssignmentOfDeclaredExternalModule_1.ts (2 errors) ====
|
|
|
|
///<reference path='exportAssignmentOfDeclaredExternalModule_0.ts'/>
|
|
|
|
import Sammy = require('exportAssignmentOfDeclaredExternalModule_0');
|
|
|
|
var x = new Sammy(); // error to use as constructor as there is not constructor symbol
|
|
|
|
~~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2304: Cannot find name 'Sammy'.
|
2014-07-13 01:04:16 +02:00
|
|
|
var y = Sammy(); // error to use interface name as call target
|
|
|
|
~~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2304: Cannot find name 'Sammy'.
|
2014-07-13 01:04:16 +02:00
|
|
|
var z: Sammy; // no error - z is of type interface Sammy from module 'M'
|
|
|
|
var a = new z(); // constructor - no error
|
|
|
|
var b = z(); // call signature - no error
|
|
|
|
==== tests/cases/compiler/exportAssignmentOfDeclaredExternalModule_0.ts (0 errors) ====
|
|
|
|
interface Sammy {
|
|
|
|
new (): any; // a constructor signature
|
|
|
|
(): number; // a 0 arg call signature
|
|
|
|
}
|
|
|
|
export = Sammy;
|
|
|
|
|