Improve semchecking for duplicate cases in case statements (#7176)
* Improve semchecking for duplicate cases in case statements * Revert to previous solution * Improve test
This commit is contained in:
parent
ba6e11fc88
commit
e4515f304a
3 changed files with 66 additions and 4 deletions
|
|
@ -151,6 +151,11 @@ proc complement*(a: PNode): PNode =
|
|||
for i in countup(0, high(x)): x[i] = not x[i]
|
||||
result = toTreeSet(x, a.typ, a.info)
|
||||
|
||||
proc deduplicate*(a: PNode): PNode =
|
||||
var x: TBitSet
|
||||
toBitSet(a, x)
|
||||
result = toTreeSet(x, a.typ, a.info)
|
||||
|
||||
proc cardSet(s: PNode): BiggestInt =
|
||||
# here we can do better than converting it into a compact set
|
||||
# we just count the elements directly
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue