Skip to content

Commit

Permalink
Update SemanticModel.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
LPeter1997 committed Nov 3, 2024
1 parent 312be23 commit 5d32842
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Draco.Compiler/Api/Semantics/SemanticModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,12 @@ public ImmutableArray<ISymbol> GetAllAccessibleSymbols(SyntaxNode? node)
}
case SourceClassSymbol classSymbol:
{
// Could be the class itself
if (classSymbol.DeclaringSyntax == syntax) return containingSymbol;

// Search for the corresponding syntax
var symbol = classSymbol.Members
.SingleOrDefault(sym => sym.DeclaringSyntax == syntax);

return symbol;
}
default:
Expand Down

0 comments on commit 5d32842

Please sign in to comment.