Skip to content

Commit 088b19e

Browse files
authored
Fix checker bugs which make errors unstable (microsoft#424)
1 parent a3c2747 commit 088b19e

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

internal/checker/checker.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1586,6 +1586,7 @@ func (c *Checker) getSuggestionForSymbolNameLookup(symbols ast.SymbolTable, name
15861586
return symbol
15871587
}
15881588
allSymbols := slices.Collect(maps.Values(symbols))
1589+
c.sortSymbols(allSymbols)
15891590
if meaning&ast.SymbolFlagsGlobalLookup != 0 {
15901591
allSymbols = slices.Concat([]*ast.Symbol{
15911592
c.newSymbol(ast.SymbolFlagsTypeAlias, "string"),

internal/checker/relater.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4266,7 +4266,7 @@ func (r *Relater) reportUnmatchedProperty(source *Type, target *Type, unmatchedP
42664266
props := r.c.getUnmatchedProperties(source, target, requireOptionalProperties, false /*matchDiscriminantProperties*/)
42674267
if len(props) == 1 {
42684268
propName := r.c.symbolToString(unmatchedProperty)
4269-
r.reportError(diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, unmatchedProperty.Name, r.c.TypeToString(source), r.c.TypeToString(target))
4269+
r.reportError(diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName, r.c.TypeToString(source), r.c.TypeToString(target))
42704270
if len(unmatchedProperty.Declarations) != 0 {
42714271
r.relatedInfo = append(r.relatedInfo, createDiagnosticForNode(unmatchedProperty.Declarations[0], diagnostics.X_0_is_declared_here, propName))
42724272
}

0 commit comments

Comments
 (0)