diff --git a/runtime/interpreter/value.go b/runtime/interpreter/value.go index 24c6e0947f..5187bd4c02 100644 --- a/runtime/interpreter/value.go +++ b/runtime/interpreter/value.go @@ -17173,7 +17173,7 @@ func (v *CompositeValue) ConformsToStaticType( } } - fieldsLen := int(v.dictionary.Count()) + fieldsLen := v.FieldCount() computedFields := v.GetComputedFields(interpreter) if computedFields != nil { @@ -17224,6 +17224,10 @@ func (v *CompositeValue) ConformsToStaticType( return true } +func (v *CompositeValue) FieldCount() int { + return int(v.dictionary.Count()) +} + func (v *CompositeValue) IsStorable() bool { // Only structures, resources, enums, and contracts can be stored.