Skip to content

Commit cce1d9c

Browse files
authored
Merge pull request #527 from fwcd/syntax-buildable-type-hash
Make `SyntaxBuildableType` hashable
2 parents 441a8c9 + 6826d64 commit cce1d9c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Sources/SwiftSyntaxBuilder/gyb_helpers/SyntaxBuildableWrappers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ def __eq__(self, other):
159159
return self.syntax_kind == other.syntax_kind and \
160160
self.is_optional == other.is_optional and \
161161
self.token_kind == other.token_kind
162+
163+
def __hash__(self):
164+
return hash((self.syntax_kind, self.is_optional, self.token_kind))
162165

163166
def _optional_question_mark(self):
164167
if self.is_optional:

0 commit comments

Comments
 (0)