Skip to content

Commit dfc91bb

Browse files
committed
Swift: make type non optional in TypeRepr
1 parent 72a4bd3 commit dfc91bb

File tree

4 files changed

+3
-10
lines changed

4 files changed

+3
-10
lines changed

swift/codegen/schema.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ Stmt:
214214

215215
TypeRepr:
216216
_extends: AstNode
217-
type: Type? # type can be absent on unresolved entities
217+
type: Type
218218

219219
FunctionType:
220220
_extends: AnyFunctionType

swift/ql/lib/codeql/swift/generated/Raw.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ module Raw {
319319
class TypeRepr extends @type_repr, AstNode {
320320
override string toString() { result = "TypeRepr" }
321321

322-
Type getType() { type_repr_types(this, result) }
322+
Type getType() { type_reprs(this, result) }
323323
}
324324

325325
class UnboundGenericType extends @unbound_generic_type, AnyGenericType {

swift/ql/lib/codeql/swift/generated/type/TypeRepr.qll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,4 @@ class TypeReprBase extends Synth::TTypeRepr, AstNode {
1212
}
1313

1414
final Type getType() { result = getImmediateType().resolve() }
15-
16-
final predicate hasType() { exists(getType()) }
1715
}

swift/ql/lib/swift.dbscheme

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -531,12 +531,7 @@ expr_types( //dir=expr
531531
;
532532

533533
type_reprs( //dir=type
534-
unique int id: @type_repr
535-
);
536-
537-
#keyset[id]
538-
type_repr_types( //dir=type
539-
int id: @type_repr ref,
534+
unique int id: @type_repr,
540535
int type_: @type ref
541536
);
542537

0 commit comments

Comments
 (0)