Remove error with noImplicitAny

This commit is contained in:
Kanchalai Tanglertsampan
2017-03-28 12:38:41 -07:00
parent 486dc91f76
commit 6080c3efd6
4 changed files with 7 additions and 29 deletions
-10
View File
@@ -284,7 +284,6 @@ namespace ts {
let deferredGlobalAsyncIterableIteratorType: GenericType;
let deferredGlobalTemplateStringsArrayType: ObjectType;
let deferredJsxElementClassType: Type;
let deferredGlobalPromiseAnyType: Type;
let deferredNodes: Node[];
let deferredUnusedIdentifierNodes: Node[];
@@ -3456,11 +3455,6 @@ namespace ts {
// Use the type of the initializer expression if one is present
if (declaration.initializer) {
const type = checkDeclarationInitializer(declaration);
if (isImportCall(declaration.initializer)) {
if (noImplicitAny && type === getGlobalPromiseAnyType()) {
error(declaration, Diagnostics.Cannot_resolve_dynamic_import_implicitly_has_a_Promise_any_type); }
}
return addOptionality(type, /*optional*/ declaration.questionToken && includeOptionality);
}
@@ -6089,10 +6083,6 @@ namespace ts {
return deferredGlobalPromiseType || (deferredGlobalPromiseType = getGlobalType("Promise", /*arity*/ 1, reportErrors)) || emptyGenericType;
}
function getGlobalPromiseAnyType() {
return deferredGlobalPromiseAnyType || (deferredGlobalPromiseAnyType = createPromiseType(anyType));
}
function getGlobalPromiseConstructorSymbol(reportErrors: boolean): Symbol | undefined {
return deferredGlobalPromiseConstructorSymbol || (deferredGlobalPromiseConstructorSymbol = getGlobalValueSymbol("Promise", reportErrors));
}
+4 -7
View File
@@ -1,4 +1,4 @@
{
{
"Unterminated string literal.": {
"category": "Error",
"code": 1002
@@ -3174,14 +3174,11 @@
"category": "Error",
"code": 7034
},
"Cannot resolve dynamic import, implicitly has a 'Promise<any>' type.": {
"category": "Error",
"code": 7035
},
"Dynamic import's specifier must be of type 'string', but here has type '{0}'.": {
"category": "Error",
"code": 7036
"category": "Error",
"code": 7035
},
"You cannot rename this element.": {
"category": "Error",
"code": 8000