mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 21:36:50 -05:00
Merge branch 'master' into constLet
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
//// [tests/cases/compiler/declFileAliasUseBeforeDeclaration.ts] ////
|
||||
|
||||
//// [declFileAliasUseBeforeDeclaration_foo.ts]
|
||||
|
||||
export class Foo { }
|
||||
|
||||
//// [declFileAliasUseBeforeDeclaration_test.ts]
|
||||
export function bar(a: foo.Foo) { }
|
||||
import foo = require("declFileAliasUseBeforeDeclaration_foo");
|
||||
|
||||
//// [declFileAliasUseBeforeDeclaration_foo.js]
|
||||
var Foo = (function () {
|
||||
function Foo() {
|
||||
}
|
||||
return Foo;
|
||||
})();
|
||||
exports.Foo = Foo;
|
||||
//// [declFileAliasUseBeforeDeclaration_test.js]
|
||||
function bar(a) {
|
||||
}
|
||||
exports.bar = bar;
|
||||
|
||||
|
||||
//// [declFileAliasUseBeforeDeclaration_foo.d.ts]
|
||||
export declare class Foo {
|
||||
}
|
||||
//// [declFileAliasUseBeforeDeclaration_test.d.ts]
|
||||
export declare function bar(a: foo.Foo): void;
|
||||
import foo = require("declFileAliasUseBeforeDeclaration_foo");
|
||||
@@ -0,0 +1,15 @@
|
||||
=== tests/cases/compiler/declFileAliasUseBeforeDeclaration_test.ts ===
|
||||
export function bar(a: foo.Foo) { }
|
||||
>bar : (a: foo.Foo) => void
|
||||
>a : foo.Foo
|
||||
>foo : unknown
|
||||
>Foo : foo.Foo
|
||||
|
||||
import foo = require("declFileAliasUseBeforeDeclaration_foo");
|
||||
>foo : typeof foo
|
||||
|
||||
=== tests/cases/compiler/declFileAliasUseBeforeDeclaration_foo.ts ===
|
||||
|
||||
export class Foo { }
|
||||
>Foo : Foo
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
//// [declFileAliasUseBeforeDeclaration2.ts]
|
||||
|
||||
declare module "test" {
|
||||
module A {
|
||||
class C {
|
||||
}
|
||||
}
|
||||
class B extends E {
|
||||
}
|
||||
import E = A.C;
|
||||
}
|
||||
|
||||
//// [declFileAliasUseBeforeDeclaration2.js]
|
||||
|
||||
|
||||
//// [declFileAliasUseBeforeDeclaration2.d.ts]
|
||||
declare module "test" {
|
||||
module A {
|
||||
class C {
|
||||
}
|
||||
}
|
||||
class B extends E {
|
||||
}
|
||||
import E = A.C;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
=== tests/cases/compiler/declFileAliasUseBeforeDeclaration2.ts ===
|
||||
|
||||
declare module "test" {
|
||||
module A {
|
||||
>A : typeof A
|
||||
|
||||
class C {
|
||||
>C : C
|
||||
}
|
||||
}
|
||||
class B extends E {
|
||||
>B : B
|
||||
>E : E
|
||||
}
|
||||
import E = A.C;
|
||||
>E : typeof E
|
||||
>A : typeof A
|
||||
>C : E
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
//@module: commonjs
|
||||
//@declaration: true
|
||||
|
||||
// @Filename: declFileAliasUseBeforeDeclaration_foo.ts
|
||||
export class Foo { }
|
||||
|
||||
// @Filename: declFileAliasUseBeforeDeclaration_test.ts
|
||||
export function bar(a: foo.Foo) { }
|
||||
import foo = require("declFileAliasUseBeforeDeclaration_foo");
|
||||
12
tests/cases/compiler/declFileAliasUseBeforeDeclaration2.ts
Normal file
12
tests/cases/compiler/declFileAliasUseBeforeDeclaration2.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
//@module: commonjs
|
||||
//@declaration: true
|
||||
|
||||
declare module "test" {
|
||||
module A {
|
||||
class C {
|
||||
}
|
||||
}
|
||||
class B extends E {
|
||||
}
|
||||
import E = A.C;
|
||||
}
|
||||
19
tests/cases/fourslash/getDeclarationDiagnostics.ts
Normal file
19
tests/cases/fourslash/getDeclarationDiagnostics.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @declaration: true
|
||||
// @out: true
|
||||
|
||||
// @Filename: inputFile1.ts
|
||||
//// module m {
|
||||
//// export class C implements I { }
|
||||
//// interface I { }
|
||||
//// } /*1*/
|
||||
|
||||
// @Filename: input2.ts
|
||||
//// var x = "hello world"; /*2*/
|
||||
|
||||
goTo.marker("1");
|
||||
verify.numberOfErrorsInCurrentFile(1);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.numberOfErrorsInCurrentFile(0);
|
||||
Reference in New Issue
Block a user