diff --git a/src/language/scoping/safe-ds-scope-computation.ts b/src/language/scoping/safe-ds-scope-computation.ts index 447fcd205..9f121d370 100644 --- a/src/language/scoping/safe-ds-scope-computation.ts +++ b/src/language/scoping/safe-ds-scope-computation.ts @@ -42,6 +42,7 @@ export class SafeDsScopeComputation extends DefaultScopeComputation { const description = this.descriptions.createDescription(node, name, document); this.addToScopesIfKeyIsDefined(scopes, node.parameterList, description); + this.addToScopesIfKeyIsDefined(scopes, node.parentTypeList, description); this.addToScopesIfKeyIsDefined(scopes, node.constraintList, description); this.addToScopesIfKeyIsDefined(scopes, node.body, description); diff --git a/tests/resources/scoping/named types/to containing named type declaration/main.sdstest b/tests/resources/scoping/named types/to containing named type declaration/main.sdstest index 39d7d37a7..efa19338c 100644 --- a/tests/resources/scoping/named types/to containing named type declaration/main.sdstest +++ b/tests/resources/scoping/named types/to containing named type declaration/main.sdstest @@ -4,7 +4,8 @@ package test.scoping.namedTypes.toContainingNamedTypeDeclaration class »MyClass«( // $TEST$ references outerClass p: »MyClass« -) where { +// $TEST$ references outerClass +) sub »MyClass« where { // $TEST$ references outerClass T sub »MyClass« } { @@ -65,7 +66,10 @@ class »MyClass«( // $TEST$ unresolved p2: »MyEnum«, - ) { + + // $TEST$ references innerClass + // $TEST$ unresolved + ) sub »MyClass«, »MyEnum« { // $TEST$ references innerClass attr a1: »MyClass«