comments about what we resolve, and remove a debug comment

This commit is contained in:
Erik Krogh Kristensen
2022-06-17 09:09:58 +02:00
parent 96eacd0ea6
commit 2b5af15d80
3 changed files with 6 additions and 3 deletions

View File

@@ -114,7 +114,6 @@ class Module_ extends FileOrModule, TModule {
}
}
// class ModuleRef = AstNodes::TModuleExpr or AstNodes::TType;
private predicate resolveQualifiedName(Import imp, ContainerOrModule m, int i) {
not m = TFile(any(File f | f.getExtension() = "ql")) and
exists(string q | q = imp.getQualifiedName(i) |
@@ -264,8 +263,10 @@ private predicate definesModule(
public = false and
ty = sig.asModuleRef()
|
// resolve to the signature module
m = ty.getResolvedModule()
or
// resolve to the arguments of the instantiated module
exists(ModuleExpr inst | inst.getResolvedModule().asModule() = mod |
m = inst.getArgument(i).asModuleRef().getResolvedModule()
)

View File

@@ -74,8 +74,10 @@ private module Cached {
mod.hasParameter(i, pc.getPredicateName(), sig) and
sig.getArity() = pc.getNumberOfArguments()
|
// resolve to the signature predicate
p = sig.getResolvedPredicate() // <- this is a `signature predicate`, but that's fine.
or
// resolve to the instantiations
exists(ModuleExpr inst, SignatureExpr arg | inst.getResolvedModule().asModule() = mod |
arg = inst.getArgument(i) and
p = arg.asPredicate().getResolvedPredicate()

View File

@@ -330,10 +330,10 @@ private predicate defines(FileOrModule m, string name, Type t, boolean public) {
mod.hasParameter(i, name, param) and
public = true
|
// we resolve it both to the signature type
// resolve to the signature class
t = param.asType().getResolvedType()
or
// or any instantiated type
// resolve to the instantiations
exists(ModuleExpr inst, SignatureExpr arg |
inst.getArgument(i) = arg and
inst.getResolvedModule() = m and