Skip to content

Commit 116006d

Browse files
committed
Swift: Fix for type names containing '...'.
1 parent 40219aa commit 116006d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Type extends Generated::Type {
1515
// replace anything that looks like a full name `a.b.c` with just the
1616
// short name `c`, by removing the `a.` and `b.` parts. Note that this
1717
// has to be robust for tuple type names such as `(a, b.c)`.
18-
result = super.getName().regexpReplaceAll("[^(), ]*\\.", "")
18+
result = super.getName().regexpReplaceAll("[^(),. ]+\\.(?!\\.)", "")
1919
}
2020

2121
/**
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
| Int... | getName: | | getCanonicalType: | Array<Int> | getBaseType: | Int |
2-
| T... | getName: | | getCanonicalType: | Array<T> | getBaseType: | T |
3-
| T... | getName: | | getCanonicalType: | Array<\u03c4_0_0> | getBaseType: | T |
1+
| Int... | getName: | Int... | getCanonicalType: | Array<Int> | getBaseType: | Int |
2+
| T... | getName: | T... | getCanonicalType: | Array<T> | getBaseType: | T |
3+
| T... | getName: | T... | getCanonicalType: | Array<\u03c4_0_0> | getBaseType: | T |

0 commit comments

Comments
 (0)