Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 41a1cd9

Browse filesBrowse files
committed
chore: more change
1 parent 4fce495 commit 41a1cd9
Copy full SHA for 41a1cd9

1 file changed

+6-5Lines changed: 6 additions & 5 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/compiler/checker.ts‎

Copy file name to clipboardExpand all lines: src/compiler/checker.ts
+6-5Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13246,7 +13246,7 @@ namespace ts {
1324613246
}
1324713247
else {
1324813248
let suggestion: string | undefined;
13249-
if (propName !== undefined && (suggestion = getSuggestionForNonexistentProperty(propName as string, objectType, /*isJsxAttr*/ false))) {
13249+
if (propName !== undefined && (suggestion = getSuggestionForNonexistentProperty(propName as string, objectType))) {
1325013250
if (suggestion !== undefined) {
1325113251
error(accessExpression.argumentExpression, Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, propName as string, typeToString(objectType), suggestion);
1325213252
}
@@ -16320,7 +16320,8 @@ namespace ts {
1632016320
errorNode = prop.valueDeclaration.name;
1632116321
}
1632216322
const propName = symbolToString(prop);
16323-
const suggestion = getSuggestionForNonexistentProperty(propName, errorTarget, /*isJsxAttr*/ true);
16323+
const suggestionSymbol = getSuggestedSymbolForNonexistentJSXAttribute(propName, errorTarget);
16324+
const suggestion = suggestionSymbol ? symbolToString(suggestionSymbol) : undefined;
1632416325
if (suggestion) reportError(Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, propName, typeToString(errorTarget), suggestion);
1632516326
else reportError(Diagnostics.Property_0_does_not_exist_on_type_1, propName, typeToString(errorTarget));
1632616327
}
@@ -16336,7 +16337,7 @@ namespace ts {
1633616337

1633716338
const name = propDeclaration.name!;
1633816339
if (isIdentifier(name)) {
16339-
suggestion = getSuggestionForNonexistentProperty(name, errorTarget, /*isJsxAttr*/ false);
16340+
suggestion = getSuggestionForNonexistentProperty(name, errorTarget);
1634016341
}
1634116342
}
1634216343
if (suggestion !== undefined) {
@@ -24892,8 +24893,8 @@ namespace ts {
2489224893
return defaultSuggestion();
2489324894
}
2489424895

24895-
function getSuggestionForNonexistentProperty(name: Identifier | PrivateIdentifier | string, containingType: Type, isJsxAttr: boolean): string | undefined {
24896-
const suggestion = (isJsxAttr ? getSuggestedSymbolForNonexistentJSXAttribute : getSuggestedSymbolForNonexistentProperty)(name, containingType);
24896+
function getSuggestionForNonexistentProperty(name: Identifier | PrivateIdentifier | string, containingType: Type): string | undefined {
24897+
const suggestion = getSuggestedSymbolForNonexistentProperty(name, containingType);
2489724898
return suggestion && symbolName(suggestion);
2489824899
}
2489924900

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.