@@ -743,7 +743,9 @@ class Module extends TModule, ModuleDeclaration {
743743 }
744744
745745 /** Gets a ref to the module that this module implements. */
746- TypeExpr getImplements ( int i ) { toQL ( result ) = mod .getImplements ( i ) .getTypeExpr ( ) }
746+ TypeRef getImplements ( int i ) {
747+ exists ( SignatureExpr sig | sig .toQL ( ) = mod .getImplements ( i ) | result = sig .asType ( ) )
748+ }
747749
748750 /** Gets the module expression that this module is an alias for, if any. */
749751 ModuleExpr getAlias ( ) { toQL ( result ) = mod .getAFieldOrChild ( ) .( QL:: ModuleAliasBody ) .getChild ( ) }
@@ -2293,7 +2295,7 @@ class ModuleExpr extends TModuleExpr, TypeRef {
22932295
22942296 /**
22952297 * Gets the `i`th type argument if this module is a module instantiation.
2296- * The result is either a `PredicateExpr` or a `TypeExpr `.
2298+ * The result is either a `PredicateExpr`, `TypeExpr`, or `ModuleExpr `.
22972299 */
22982300 SignatureExpr getArgument ( int i ) {
22992301 result .toQL ( ) = me .getAFieldOrChild ( ) .( QL:: ModuleInstantiation ) .getChild ( i )
@@ -2313,14 +2315,16 @@ class ModuleExpr extends TModuleExpr, TypeRef {
23132315 }
23142316}
23152317
2316- /** A signature expression, either a `PredicateExpr` or a `TypeExpr `. */
2318+ /** A signature expression, either a `PredicateExpr`, a `TypeExpr`, or a `ModuleExpr `. */
23172319class SignatureExpr extends TSignatureExpr , AstNode {
23182320 QL:: SignatureExpr sig ;
23192321
23202322 SignatureExpr ( ) {
23212323 toQL ( this ) = sig .getPredicate ( )
23222324 or
23232325 toQL ( this ) = sig .getTypeExpr ( )
2326+ or
2327+ toQL ( this ) = sig .getModExpr ( )
23242328 }
23252329
23262330 /** Gets the generated AST node that contains this signature expression. */
@@ -2329,8 +2333,8 @@ class SignatureExpr extends TSignatureExpr, AstNode {
23292333 /** Gets this signature expression if it represents a predicate expression. */
23302334 PredicateExpr asPredicate ( ) { result = this }
23312335
2332- /** Gets this signature expression if it represents a type expression. */
2333- TypeExpr asType ( ) { result = this }
2336+ /** Gets this signature expression if it represents a type expression (either a `TypeExpr` or a `ModuleExpr`) . */
2337+ TypeRef asType ( ) { result = this }
23342338}
23352339
23362340/** An argument to an annotation. */
0 commit comments