unisonweb / unison

A friendly programming language from the future
https://unison-lang.org
Other
5.81k stars 271 forks source link

Fix diffs involving unit/tuples #5462

Open ChrisPenner opened 1 day ago

ChrisPenner commented 1 day ago

Overview

The diff calculator was crashing when there was a change like: (blah, 1) -> (blah, ()) because it thought the ) from the () was related to the ending paren, which was just a syntax element and it didn't know how to create a hash-change annotation from the paren that was just a bracket.

Implementation notes

I've solved this case by just re-splitting any confusing cases into old and new chunks, which should fix this and any other cases I may have missed.

Test coverage

Added a regression test for this case.