Skip to content

Commit 1e7ce8c

Browse files
authored
Merge pull request #1451 from hvitved/csharp/element-preds
C#: Move two predicates from `csharp/Element.qll` to `dotnet/Element.qll`
2 parents 41d5d5a + 8c8929a commit 1e7ce8c

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

csharp/ql/src/semmle/code/csharp/Element.qll

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ class Element extends DotNet::Element, @element {
2727
/** Gets a location of this element, including sources and assemblies. */
2828
override Location getALocation() { none() }
2929

30-
override File getFile() { result = getLocation().getFile() }
31-
32-
override predicate fromSource() { this.getFile().fromSource() }
33-
3430
/** Holds if this element is from an assembly. */
3531
predicate fromLibrary() { this.getFile().fromLibrary() }
3632

csharp/ql/src/semmle/code/dotnet/Element.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ class Element extends @dotnet_element {
2222
Location getALocation() { none() }
2323

2424
/** Gets the file containing this element. */
25-
File getFile() { result = getLocation().getFile() }
25+
final File getFile() { result = this.getLocation().getFile() }
2626

2727
/** Holds if this element is from source code. */
28-
predicate fromSource() { none() }
28+
predicate fromSource() { this.getFile().fromSource() }
2929

3030
/**
3131
* Gets the "language" of this program element, as defined by the extension of the filename.

0 commit comments

Comments
 (0)