Skip to content

Commit f042195

Browse files
committed
Swift: Connect it up.
1 parent d870321 commit f042195

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

swift/ql/lib/codeql/swift/elements/type/TypeAliasType.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class TypeAliasType extends Generated::TypeAliasType {
1010
* typealias MyInt = Int
1111
* ```
1212
*/
13-
Type getAliasedType() { none() } // TODO: not yet implemented.
13+
Type getAliasedType() { result = this.getDecl().getAliasedType() }
1414

15-
override Type getUnderlyingType() { result = this } // TODO: not yet implemented.
15+
override Type getUnderlyingType() { result = this.getAliasedType().getUnderlyingType() }
1616
}

swift/ql/test/extractor-tests/declarations/all.ql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import swift
22

33
string describe(Decl decl) {
4-
//result = "getAliasedType:" + decl.(TypeAliasDecl).getAliasedType().toString() TODO: not yet implemented
5-
none()
4+
result = "getAliasedType:" + decl.(TypeAliasDecl).getAliasedType().toString()
65
}
76

87
from Decl decl

swift/ql/test/library-tests/elements/type/nominaltype/nominaltypedecl.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import swift
22

33
string describe(TypeDecl td) {
4-
//result = "getAliasedType:" + td.(TypeAliasDecl).getAliasedType() TODO: not yet implemented.
5-
//or
4+
result = "getAliasedType:" + td.(TypeAliasDecl).getAliasedType()
5+
or
66
result = "getABaseType:" + td.(NominalTypeDecl).getABaseType()
77
}
88

0 commit comments

Comments
 (0)