mirror of
https://github.com/github/codeql.git
synced 2026-05-04 13:15:21 +02:00
Kotlin: Add AnyDbType
All DbType* types extend it, and `Label`s require their argument to be a subtype of it.
This commit is contained in:
@@ -171,13 +171,12 @@ with open('src/main/kotlin/KotlinExtractorDbScheme.kt', 'w') as kt:
|
||||
for num, typ in mapping:
|
||||
genTable(kt, relname, columns, enum, kind, num, typ)
|
||||
|
||||
kt.write('sealed interface AnyDbType\n')
|
||||
for typ in sorted(supertypes):
|
||||
kt.write('sealed interface Db' + upperFirst(typ))
|
||||
kt.write('sealed interface Db' + upperFirst(typ) + ': AnyDbType')
|
||||
# Sorting makes the output deterministic.
|
||||
names = sorted(supertypes[typ])
|
||||
if names:
|
||||
kt.write(': ')
|
||||
kt.write(', '.join(map(lambda name: 'Db' + upperFirst(name), names)))
|
||||
kt.write(''.join(map(lambda name: ', Db' + upperFirst(name), names)))
|
||||
kt.write('\n')
|
||||
for alias in sorted(type_aliases):
|
||||
kt.write('typealias Db' + upperFirst(alias) + ' = Db' + upperFirst(type_aliases[alias]) + '\n')
|
||||
|
||||
Reference in New Issue
Block a user