Skip to content

Commit

Permalink
Merge pull request #3003 from onflow/bastian/v0.42-add-composite-valu…
Browse files Browse the repository at this point in the history
…e-field-count-getter
  • Loading branch information
turbolent authored Jan 9, 2024
2 parents e327b5e + 58cb1cf commit 5c393f8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion runtime/interpreter/value.go
Original file line number Diff line number Diff line change
Expand Up @@ -17075,7 +17075,7 @@ func (v *CompositeValue) ConformsToStaticType(
}
}

fieldsLen := int(v.dictionary.Count())
fieldsLen := v.FieldCount()
if v.ComputedFields != nil {
fieldsLen += len(v.ComputedFields)
}
Expand Down Expand Up @@ -17122,6 +17122,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.
Expand Down

0 comments on commit 5c393f8

Please sign in to comment.