titzer / virgil

A fast and lightweight native programming language
1.23k stars 44 forks source link

[unbox] Fix variant equality to be case-by-case #226

Closed btwj closed 6 months ago

btwj commented 6 months ago

Variant equality is now done on a case-by-case basis. Previously, it did not correctly dispatch the variant equality method.

In the added test case, the old version would merge B and C together to become #ref, and then use RefEq instead, which is incorrect.