Baselines, using 'unknown' as a default type.

This commit is contained in:
Daniel Rosenwasser 2014-11-12 18:08:16 -08:00
parent e8ec2966a2
commit 828e31b318
6 changed files with 5 additions and 13 deletions

View file

@ -9103,9 +9103,11 @@ module ts {
globalBooleanType = getGlobalType("Boolean");
globalRegExpType = getGlobalType("RegExp");
if (compilerOptions.target >= ScriptTarget.ES6) {
globalTemplateStringsArrayType = getGlobalType("TemplateStringsArray");
}
// If we're in ES6 mode, load the TemplateStringsArray.
// Otherwise, default to 'unknown' for the purposes of type checking in LS scenarios.
globalTemplateStringsArrayType = compilerOptions.target >= ScriptTarget.ES6
? getGlobalType("TemplateStringsArray")
: unknownType;
}
initializeTypeChecker();

View file

@ -1,12 +1,10 @@
error TS2318: Cannot find global type 'Boolean'.
error TS2318: Cannot find global type 'IArguments'.
error TS2318: Cannot find global type 'TemplateStringsArray'.
tests/cases/compiler/noDefaultLib.ts(4,11): error TS2317: Global type 'Array' must have 1 type parameter(s).
!!! error TS2318: Cannot find global type 'Boolean'.
!!! error TS2318: Cannot find global type 'IArguments'.
!!! error TS2318: Cannot find global type 'TemplateStringsArray'.
==== tests/cases/compiler/noDefaultLib.ts (1 errors) ====
/// <reference no-default-lib="true"/>
var x;

View file

@ -6,7 +6,6 @@ error TS2318: Cannot find global type 'Number'.
error TS2318: Cannot find global type 'Object'.
error TS2318: Cannot find global type 'RegExp'.
error TS2318: Cannot find global type 'String'.
error TS2318: Cannot find global type 'TemplateStringsArray'.
!!! error TS2318: Cannot find global type 'Array'.
@ -17,7 +16,6 @@ error TS2318: Cannot find global type 'TemplateStringsArray'.
!!! error TS2318: Cannot find global type 'Object'.
!!! error TS2318: Cannot find global type 'RegExp'.
!!! error TS2318: Cannot find global type 'String'.
!!! error TS2318: Cannot find global type 'TemplateStringsArray'.
==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509698.ts (0 errors) ====
/// <style requireSemi="on" />
/// <reference no-default-lib="true"/>

View file

@ -6,7 +6,6 @@ error TS2318: Cannot find global type 'Number'.
error TS2318: Cannot find global type 'Object'.
error TS2318: Cannot find global type 'RegExp'.
error TS2318: Cannot find global type 'String'.
error TS2318: Cannot find global type 'TemplateStringsArray'.
test.ts(3,8): error TS2304: Cannot find name 'Array'.
@ -18,7 +17,6 @@ test.ts(3,8): error TS2304: Cannot find name 'Array'.
!!! error TS2318: Cannot find global type 'Object'.
!!! error TS2318: Cannot find global type 'RegExp'.
!!! error TS2318: Cannot find global type 'String'.
!!! error TS2318: Cannot find global type 'TemplateStringsArray'.
==== test.ts (1 errors) ====
/// <reference no-default-lib="true"/>

View file

@ -6,7 +6,6 @@ error TS2318: Cannot find global type 'Number'.
error TS2318: Cannot find global type 'Object'.
error TS2318: Cannot find global type 'RegExp'.
error TS2318: Cannot find global type 'String'.
error TS2318: Cannot find global type 'TemplateStringsArray'.
test.ts(3,8): error TS2304: Cannot find name 'Array'.
@ -18,7 +17,6 @@ test.ts(3,8): error TS2304: Cannot find name 'Array'.
!!! error TS2318: Cannot find global type 'Object'.
!!! error TS2318: Cannot find global type 'RegExp'.
!!! error TS2318: Cannot find global type 'String'.
!!! error TS2318: Cannot find global type 'TemplateStringsArray'.
==== test.ts (1 errors) ====
/// <reference no-default-lib="true"/>

View file

@ -6,7 +6,6 @@ error TS2318: Cannot find global type 'Number'.
error TS2318: Cannot find global type 'Object'.
error TS2318: Cannot find global type 'RegExp'.
error TS2318: Cannot find global type 'String'.
error TS2318: Cannot find global type 'TemplateStringsArray'.
tests/cases/compiler/typeCheckTypeArgument.ts(3,19): error TS2304: Cannot find name 'UNKNOWN'.
tests/cases/compiler/typeCheckTypeArgument.ts(5,26): error TS2304: Cannot find name 'UNKNOWN'.
tests/cases/compiler/typeCheckTypeArgument.ts(7,21): error TS2304: Cannot find name 'UNKNOWN'.
@ -23,7 +22,6 @@ tests/cases/compiler/typeCheckTypeArgument.ts(15,13): error TS2304: Cannot find
!!! error TS2318: Cannot find global type 'Object'.
!!! error TS2318: Cannot find global type 'RegExp'.
!!! error TS2318: Cannot find global type 'String'.
!!! error TS2318: Cannot find global type 'TemplateStringsArray'.
==== tests/cases/compiler/typeCheckTypeArgument.ts (6 errors) ====
/// <reference no-default-lib="true"/>