Skip to content

Commit

Permalink
OOOPS... had to fix == for pure instances and dictionaries.
Browse files Browse the repository at this point in the history
  • Loading branch information
quephird committed Mar 28, 2024
1 parent ca32ed9 commit 35dc03d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions slox/LoxValue.swift
Expand Up @@ -137,6 +137,10 @@ enum LoxValue: CustomStringConvertible, Equatable, Hashable {
return leftFunc == rightFunc
case (.instance(let leftList as LoxList), .instance(let rightList as LoxList)):
return leftList.elements == rightList.elements
case (.instance(let leftDict as LoxDictionary), .instance(let rightDict as LoxDictionary)):
return leftDict.kvPairs == rightDict.kvPairs
case (.instance(let leftInstance), .instance(let rightInstance)):
return leftInstance.objectId == rightInstance.objectId
default:
return false
}
Expand Down

0 comments on commit 35dc03d

Please sign in to comment.