Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Avoid non-trivially shadowing string.toString()
Prepare libraries for a possible deprecation warning on shadowing
string.toString().

These instanceof classes were using this.(Type).method() to call
supertype methods, but super.method() is clearer and equivalent
for instanceof supertypes.
  • Loading branch information
ginsbach committed Feb 10, 2026
commit f60d759a6593b30375fb9f39a643ff6615046400
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ module Make<RegexTreeViewSig TreeImpl> {
)
}

string toString() { result = this.(InfiniteRepetitionQuantifier).toString() }
string toString() { result = super.toString() }
}

/**
Expand Down
24 changes: 12 additions & 12 deletions shared/regex/codeql/regex/nfa/NfaUtils.qll
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ module Make<RegexTreeViewSig TreeImpl> {
private class RegexpCharacterConstant instanceof RegExpConstant {
RegexpCharacterConstant() { this.isCharacter() }

string toString() { result = this.(RegExpConstant).toString() }
string toString() { result = super.toString() }

RegExpTerm getRootTerm() { result = this.(RegExpConstant).getRootTerm() }
RegExpTerm getRootTerm() { result = super.getRootTerm() }

string getValue() { result = this.(RegExpConstant).getValue() }
string getValue() { result = super.getValue() }
}

/**
Expand Down Expand Up @@ -578,11 +578,11 @@ module Make<RegexTreeViewSig TreeImpl> {
)
}

string toString() { result = this.(RegExpTerm).toString() }
string toString() { result = super.toString() }

RegExpTerm getAChild() { result = this.(RegExpTerm).getChild(_) }
RegExpTerm getAChild() { result = super.getChild(_) }

RegExpTerm getChild(int i) { result = this.(RegExpTerm).getChild(i) }
RegExpTerm getChild(int i) { result = super.getChild(i) }
}

/**
Expand All @@ -601,11 +601,11 @@ module Make<RegexTreeViewSig TreeImpl> {
)
}

string toString() { result = this.(RegExpTerm).toString() }
string toString() { result = super.toString() }

RegExpTerm getAChild() { result = this.(RegExpTerm).getAChild() }
RegExpTerm getAChild() { result = super.getAChild() }

RegExpTerm getChild(int i) { result = this.(RegExpTerm).getChild(i) }
RegExpTerm getChild(int i) { result = super.getChild(i) }
}

/**
Expand All @@ -621,11 +621,11 @@ module Make<RegexTreeViewSig TreeImpl> {
)
}

string toString() { result = this.(RegExpTerm).toString() }
string toString() { result = super.toString() }

RegExpTerm getAChild() { result = this.(RegExpTerm).getAChild() }
RegExpTerm getAChild() { result = super.getAChild() }

RegExpTerm getChild(int i) { result = this.(RegExpTerm).getChild(i) }
RegExpTerm getChild(int i) { result = super.getChild(i) }
}

/**
Expand Down
Loading