@@ -1106,8 +1106,8 @@ private newtype TConstLookupScope =
1106
1106
MkQualifiedLookup ( ConstantAccess base ) or
1107
1107
/** Look up in the ancestors of `mod`. */
1108
1108
MkAncestorLookup ( Module mod ) or
1109
- /** Look up in a module syntactically nested in `scope `. */
1110
- MkNestedLookup ( ModuleBase scope ) or
1109
+ /** Look up in a module syntactically nested in a declaration of `mod `. */
1110
+ MkNestedLookup ( Module mod ) or
1111
1111
/** Pseudo-scope for accesses that are known to resolve to `mod`. */
1112
1112
MkExactLookup ( Module mod )
1113
1113
@@ -1178,15 +1178,6 @@ class ConstRef extends LocalSourceNode {
1178
1178
*/
1179
1179
private ModuleNode getAncestryTarget ( ) { result .getAnAncestorExpr ( ) = this }
1180
1180
1181
- /**
1182
- * Gets a module scope in which the value of this constant is part of `Module.nesting`.
1183
- */
1184
- private ModuleBase getANestingScope ( ) {
1185
- result = this .getAncestryTarget ( ) .getADeclaration ( )
1186
- or
1187
- result .getEnclosingModule ( ) = this .getANestingScope ( )
1188
- }
1189
-
1190
1181
/**
1191
1182
* Gets the known target module.
1192
1183
*
@@ -1204,7 +1195,7 @@ class ConstRef extends LocalSourceNode {
1204
1195
access = any ( ConstantAccess ac ) .getScopeExpr ( ) and
1205
1196
result = MkQualifiedLookup ( access )
1206
1197
or
1207
- result = MkNestedLookup ( this .getANestingScope ( ) )
1198
+ result = MkNestedLookup ( this .getAncestryTarget ( ) )
1208
1199
or
1209
1200
result = MkExactLookup ( access .( Namespace ) .getModule ( ) )
1210
1201
}
@@ -1224,7 +1215,7 @@ class ConstRef extends LocalSourceNode {
1224
1215
(
1225
1216
result = MkAncestorLookup ( access .getEnclosingModule ( ) .getNamespaceOrToplevel ( ) .getModule ( ) )
1226
1217
or
1227
- result = MkNestedLookup ( access .getEnclosingModule ( ) )
1218
+ result = MkNestedLookup ( access .getEnclosingModule ( ) . getEnclosingModule * ( ) . getModule ( ) )
1228
1219
)
1229
1220
}
1230
1221
0 commit comments