Skip to content

Commit

Permalink
Merge pull request #411 from Eclalang/issue-#410-fix-eq-struct
Browse files Browse the repository at this point in the history
fixed Eq by removing variable names clash
  • Loading branch information
tot0p authored Jun 12, 2024
2 parents 84b6af2 + 61d0c84 commit 2241e11
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions interpreter/eclaType/struct.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ func (s *Struct) Eq(value Type) (Type, error) {
if len(s.Fields) != len(value.(*Struct).Fields) {
return Bool(false), nil
}
for name, value := range s.Fields {
vVal, ok := (*value).(*Struct).Fields[name]
if !ok || (vVal != value) {
for key, val := range s.Fields {
vVal, ok := value.(*Struct).Fields[key]
if !ok || (*vVal != *val) {
return Bool(false), nil
}
}
Expand Down

0 comments on commit 2241e11

Please sign in to comment.