hdl.ast: Value.matches() with no arguments should return C(1).
The behavior of the following must be always the same: - `with m.Switch(v): with m.Case(*pats):` - `with m.If(v.matches(*pats)):`
This commit is contained in:
parent
9aeb22311f
commit
ef2e9fa809
3 changed files with 3 additions and 2 deletions
|
|
@ -442,7 +442,7 @@ class Value(metaclass=ABCMeta):
|
|||
continue
|
||||
matches.append(self == pattern)
|
||||
if not matches:
|
||||
return Const(0)
|
||||
return Const(1)
|
||||
elif len(matches) == 1:
|
||||
return matches[0]
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue