Skip to content

Commit f9d62a0

Browse files
committed
C#: Narrow the use of unbound declaration locations to nested types.
1 parent 6149608 commit f9d62a0

File tree

1 file changed

+3
-1
lines changed
  • csharp/ql/lib/semmle/code/csharp

1 file changed

+3
-1
lines changed

csharp/ql/lib/semmle/code/csharp/Type.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Type extends Member, TypeContainer, @type {
3030
/** Holds if this type is implicitly convertible to `that` type. */
3131
predicate isImplicitlyConvertibleTo(Type that) { implicitConversion(this, that) }
3232

33-
override Location getALocation() { type_location(this.getUnboundDeclaration(), result) }
33+
override Location getALocation() { type_location(this, result) }
3434

3535
override Type getChild(int n) { none() }
3636

@@ -394,6 +394,8 @@ class NestedType extends ValueOrRefType {
394394
NestedType() { nested_types(this, _, _) }
395395

396396
override ValueOrRefType getDeclaringType() { nested_types(this, result, _) }
397+
398+
override Location getALocation() { type_location(this.getUnboundDeclaration(), result) }
397399
}
398400

399401
/**

0 commit comments

Comments
 (0)