Added test, modified test, updated baselines.

This commit is contained in:
Daniel Rosenwasser 2014-12-17 17:05:05 -08:00
parent fac5201765
commit 46cd90daf0
6 changed files with 80 additions and 3 deletions

View File

@ -0,0 +1,22 @@
tests/cases/compiler/cloduleWithPriorInstantiatedModule.ts(2,8): error TS2434: A module declaration cannot be located prior to a class or function with which it is merged
==== tests/cases/compiler/cloduleWithPriorInstantiatedModule.ts (1 errors) ====
// Non-ambient & instantiated module.
module Moclodule {
~~~~~~~~~
!!! error TS2434: A module declaration cannot be located prior to a class or function with which it is merged
export interface Someinterface {
foo(): void;
}
var x = 10;
}
class Moclodule {
}
// Instantiated module.
module Moclodule {
export class Manager {
}
}

View File

@ -0,0 +1,39 @@
//// [cloduleWithPriorInstantiatedModule.ts]
// Non-ambient & instantiated module.
module Moclodule {
export interface Someinterface {
foo(): void;
}
var x = 10;
}
class Moclodule {
}
// Instantiated module.
module Moclodule {
export class Manager {
}
}
//// [cloduleWithPriorInstantiatedModule.js]
// Non-ambient & instantiated module.
var Moclodule;
(function (Moclodule) {
var x = 10;
})(Moclodule || (Moclodule = {}));
var Moclodule = (function () {
function Moclodule() {
}
return Moclodule;
})();
// Instantiated module.
var Moclodule;
(function (Moclodule) {
var Manager = (function () {
function Manager() {
}
return Manager;
})();
Moclodule.Manager = Manager;
})(Moclodule || (Moclodule = {}));

View File

@ -1,5 +1,5 @@
//// [cloduleWithPriorUninstantiatedModule.ts]
// Ambient/uninstantiated module.
// Non-ambient & uninstantiated module.
module Moclodule {
export interface Someinterface {
foo(): void;

View File

@ -1,5 +1,5 @@
=== tests/cases/compiler/cloduleWithPriorUninstantiatedModule.ts ===
// Ambient/uninstantiated module.
// Non-ambient & uninstantiated module.
module Moclodule {
>Moclodule : typeof Moclodule

View File

@ -0,0 +1,16 @@
// Non-ambient & instantiated module.
module Moclodule {
export interface Someinterface {
foo(): void;
}
var x = 10;
}
class Moclodule {
}
// Instantiated module.
module Moclodule {
export class Manager {
}
}

View File

@ -1,4 +1,4 @@
// Ambient/uninstantiated module.
// Non-ambient & uninstantiated module.
module Moclodule {
export interface Someinterface {
foo(): void;