mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-11 19:27:35 -06:00
Helper rename as per PR feedback
This commit is contained in:
parent
b24883304b
commit
96f4dd51c5
@ -2843,7 +2843,7 @@ namespace ts {
|
||||
if (isBindingPattern(element.name)) {
|
||||
return getTypeFromBindingPattern(<BindingPattern>element.name, includePatternInType);
|
||||
}
|
||||
if (compilerOptions.noImplicitAny && canReportImplicitAnyError(element)) {
|
||||
if (compilerOptions.noImplicitAny && !declarationBelongsToPrivateAmbientMember(element)) {
|
||||
reportImplicitAnyError(element, anyType);
|
||||
}
|
||||
return anyType;
|
||||
@ -2936,16 +2936,17 @@ namespace ts {
|
||||
|
||||
// Report implicit any errors unless this is a private property within an ambient declaration
|
||||
if (reportErrors && compilerOptions.noImplicitAny) {
|
||||
if (canReportImplicitAnyError(declaration)) {
|
||||
if (!declarationBelongsToPrivateAmbientMember(declaration)) {
|
||||
reportImplicitAnyError(declaration, type);
|
||||
}
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
function canReportImplicitAnyError(declaration: VariableLikeDeclaration) {
|
||||
function declarationBelongsToPrivateAmbientMember(declaration: VariableLikeDeclaration) {
|
||||
const root = getRootDeclaration(declaration);
|
||||
return !isPrivateWithinAmbient(root) && !(root.kind === SyntaxKind.Parameter && isPrivateWithinAmbient(root.parent));
|
||||
const memberDeclaration = root.kind === SyntaxKind.Parameter ? root.parent : root;
|
||||
return isPrivateWithinAmbient(memberDeclaration);
|
||||
}
|
||||
|
||||
function getTypeOfVariableOrParameterOrProperty(symbol: Symbol): Type {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user