mirror of
https://github.com/github/codeql.git
synced 2026-04-27 09:45:15 +02:00
Swift: Add convenience member predicates to 'TypeDecl'.
This commit is contained in:
@@ -1,5 +1,15 @@
|
||||
private import codeql.swift.generated.decl.TypeDecl
|
||||
private import codeql.swift.generated.type.Type
|
||||
private import codeql.swift.elements.type.AnyGenericType
|
||||
|
||||
class TypeDecl extends TypeDeclBase {
|
||||
override string toString() { result = this.getName() }
|
||||
|
||||
TypeDecl getBaseTypeDecl(int i) { result = this.getBaseType(i).(AnyGenericType).getDeclaration() }
|
||||
|
||||
TypeDecl getABaseTypeDecl() { result = this.getBaseTypeDecl(_) }
|
||||
|
||||
TypeDecl getDerivedTypeDecl(int i) { result.getBaseTypeDecl(i) = this }
|
||||
|
||||
TypeDecl getADerivedTypeDecl() { result = this.getDerivedTypeDecl(_) }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user