Avoid conversion from StaticType
to sema.Type
during runtime sub-type checking
#3691
Labels
StaticType
to sema.Type
during runtime sub-type checking
#3691
Issue to be solved
In
Interpreter.IsSubType(...)
function, both the sub-type and the super-type gets converted fromStaticType
tosema.Type
(see below). This adds an unnecessary overhead.cadence/interpreter/interpreter.go
Line 4066 in b09231f
cadence/interpreter/interpreter.go
Line 4039 in b09231f
Suggested Solution
Having a separate sub-type checking implementation for runtime (static types) could eliminate this overhead. We could define the sub-typing rules in some declarative format, and then generate the two implementations from that, to make them consistent/in-sync.
The text was updated successfully, but these errors were encountered: