Skip to content

Commit e0eb820

Browse files
committed
Swift: fix extraction of BuiltinIntegerLiteralType
1 parent a1d798b commit e0eb820

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

swift/extractor/translators/TypeTranslator.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,14 @@ codeql::ProtocolCompositionType TypeTranslator::translateProtocolCompositionType
217217
return entry;
218218
}
219219

220+
codeql::BuiltinIntegerLiteralType TypeTranslator::translateBuiltinIntegerLiteralType(
221+
const swift::BuiltinIntegerLiteralType& type) {
222+
// currently the translate dispatching mechanism does not go up more than one step in the
223+
// hierarchy so we need to put this explicitly here, as BuiltinIntegerLiteralType derives from
224+
// AnyBuiltinIntegerType which then derives from BuiltinType
225+
return translateBuiltinType(type);
226+
}
227+
220228
codeql::BuiltinIntegerType TypeTranslator::translateBuiltinIntegerType(
221229
const swift::BuiltinIntegerType& type) {
222230
auto entry = createTypeEntry(type);

swift/extractor/translators/TypeTranslator.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ class TypeTranslator : public TypeTranslatorBase<TypeTranslator> {
6464
return createTypeEntry(type);
6565
}
6666

67+
codeql::BuiltinIntegerLiteralType translateBuiltinIntegerLiteralType(
68+
const swift::BuiltinIntegerLiteralType& type);
6769
codeql::BuiltinIntegerType translateBuiltinIntegerType(const swift::BuiltinIntegerType& type);
6870
codeql::OpenedArchetypeType translateOpenedArchetypeType(const swift::OpenedArchetypeType& type);
6971
codeql::ModuleType translateModuleType(const swift::ModuleType& type);

0 commit comments

Comments
 (0)