mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Remove error with noImplicitAny
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user