mirror of
https://github.com/github/codeql.git
synced 2026-04-27 09:45:15 +02:00
Swift: make type non optional in TypeRepr
This commit is contained in:
@@ -214,7 +214,7 @@ Stmt:
|
||||
|
||||
TypeRepr:
|
||||
_extends: AstNode
|
||||
type: Type? # type can be absent on unresolved entities
|
||||
type: Type
|
||||
|
||||
FunctionType:
|
||||
_extends: AnyFunctionType
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -12,6 +12,4 @@ class TypeReprBase extends Synth::TTypeRepr, AstNode {
|
||||
}
|
||||
|
||||
final Type getType() { result = getImmediateType().resolve() }
|
||||
|
||||
final predicate hasType() { exists(getType()) }
|
||||
}
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user