mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-23 18:48:40 -05:00
Handel assert for missing node kind in isDeclarationVisible for functionType and constructorType
This commit is contained in:
@@ -1617,7 +1617,9 @@ module ts {
|
||||
|
||||
case SyntaxKind.Constructor:
|
||||
case SyntaxKind.ConstructSignature:
|
||||
case SyntaxKind.ConstructorType:
|
||||
case SyntaxKind.CallSignature:
|
||||
case SyntaxKind.FunctionType:
|
||||
case SyntaxKind.IndexSignature:
|
||||
case SyntaxKind.Parameter:
|
||||
case SyntaxKind.ModuleBlock:
|
||||
|
||||
22
tests/baselines/reference/constructorTypeDeclarations.js
Normal file
22
tests/baselines/reference/constructorTypeDeclarations.js
Normal file
@@ -0,0 +1,22 @@
|
||||
//// [constructorTypeDeclarations.ts]
|
||||
|
||||
module schema {
|
||||
export function createValidator(schema: any): new <T>(data: T) => T {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
//// [constructorTypeDeclarations.js]
|
||||
var schema;
|
||||
(function (_schema) {
|
||||
function createValidator(schema) {
|
||||
return undefined;
|
||||
}
|
||||
_schema.createValidator = createValidator;
|
||||
})(schema || (schema = {}));
|
||||
|
||||
|
||||
//// [constructorTypeDeclarations.d.ts]
|
||||
declare module schema {
|
||||
function createValidator(schema: any): new <T>(data: T) => T;
|
||||
}
|
||||
17
tests/baselines/reference/constructorTypeDeclarations.types
Normal file
17
tests/baselines/reference/constructorTypeDeclarations.types
Normal file
@@ -0,0 +1,17 @@
|
||||
=== tests/cases/compiler/constructorTypeDeclarations.ts ===
|
||||
|
||||
module schema {
|
||||
>schema : typeof schema
|
||||
|
||||
export function createValidator(schema: any): new <T>(data: T) => T {
|
||||
>createValidator : (schema: any) => new <T>(data: T) => T
|
||||
>schema : any
|
||||
>T : T
|
||||
>data : T
|
||||
>T : T
|
||||
>T : T
|
||||
|
||||
return undefined;
|
||||
>undefined : undefined
|
||||
}
|
||||
}
|
||||
26
tests/baselines/reference/functionTypeDeclarations.js
Normal file
26
tests/baselines/reference/functionTypeDeclarations.js
Normal file
@@ -0,0 +1,26 @@
|
||||
//// [functionTypeDeclarations.ts]
|
||||
|
||||
module schema {
|
||||
export function createValidator(schema: any): <T>(data: T) => T {
|
||||
return <T>(data: T) => {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//// [functionTypeDeclarations.js]
|
||||
var schema;
|
||||
(function (_schema) {
|
||||
function createValidator(schema) {
|
||||
return function (data) {
|
||||
return data;
|
||||
};
|
||||
}
|
||||
_schema.createValidator = createValidator;
|
||||
})(schema || (schema = {}));
|
||||
|
||||
|
||||
//// [functionTypeDeclarations.d.ts]
|
||||
declare module schema {
|
||||
function createValidator(schema: any): <T>(data: T) => T;
|
||||
}
|
||||
24
tests/baselines/reference/functionTypeDeclarations.types
Normal file
24
tests/baselines/reference/functionTypeDeclarations.types
Normal file
@@ -0,0 +1,24 @@
|
||||
=== tests/cases/compiler/functionTypeDeclarations.ts ===
|
||||
|
||||
module schema {
|
||||
>schema : typeof schema
|
||||
|
||||
export function createValidator(schema: any): <T>(data: T) => T {
|
||||
>createValidator : (schema: any) => <T>(data: T) => T
|
||||
>schema : any
|
||||
>T : T
|
||||
>data : T
|
||||
>T : T
|
||||
>T : T
|
||||
|
||||
return <T>(data: T) => {
|
||||
><T>(data: T) => { return data; } : <T>(data: T) => T
|
||||
>T : T
|
||||
>data : T
|
||||
>T : T
|
||||
|
||||
return data;
|
||||
>data : T
|
||||
}
|
||||
}
|
||||
}
|
||||
7
tests/cases/compiler/constructorTypeDeclarations.ts
Normal file
7
tests/cases/compiler/constructorTypeDeclarations.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
// @declaration: true
|
||||
|
||||
module schema {
|
||||
export function createValidator(schema: any): new <T>(data: T) => T {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
9
tests/cases/compiler/functionTypeDeclarations.ts
Normal file
9
tests/cases/compiler/functionTypeDeclarations.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
// @declaration: true
|
||||
|
||||
module schema {
|
||||
export function createValidator(schema: any): <T>(data: T) => T {
|
||||
return <T>(data: T) => {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user