Swift: make type non optional in TypeRepr

This commit is contained in:
Paolo Tranquilli
2022-09-20 15:23:27 +02:00
parent 72a4bd3f1e
commit dfc91bb0f0
4 changed files with 3 additions and 10 deletions

View File

@@ -214,7 +214,7 @@ Stmt:
TypeRepr:
_extends: AstNode
type: Type? # type can be absent on unresolved entities
type: Type
FunctionType:
_extends: AnyFunctionType

View File

@@ -319,7 +319,7 @@ module Raw {
class TypeRepr extends @type_repr, AstNode {
override string toString() { result = "TypeRepr" }
Type getType() { type_repr_types(this, result) }
Type getType() { type_reprs(this, result) }
}
class UnboundGenericType extends @unbound_generic_type, AnyGenericType {

View File

@@ -12,6 +12,4 @@ class TypeReprBase extends Synth::TTypeRepr, AstNode {
}
final Type getType() { result = getImmediateType().resolve() }
final predicate hasType() { exists(getType()) }
}

View File

@@ -531,12 +531,7 @@ expr_types( //dir=expr
;
type_reprs( //dir=type
unique int id: @type_repr
);
#keyset[id]
type_repr_types( //dir=type
int id: @type_repr ref,
unique int id: @type_repr,
int type_: @type ref
);