links icon indicating copy to clipboard operation
links copied to clipboard

Wild can appear multiple times with different presence types

Open dhil opened this issue 4 years ago • 1 comments

The following example illustrates the bug

sig f : (() {wild:Bool |e}~> ()) {wild:Int |e}~> () fun f(g) { g() };
f = fun : (() ~a~> ()) ~a~> ()

Here wild appears twice in each row, and moreover, it appears at incompatible presence types Bool and Int with the same effect variable e. I think this issue might have to be solved in the parser since the semantic actions for squiggly_arrow inserts wild:(), which overrides the user-written wild:Bool and wild:Int.

dhil avatar Jul 02 '21 22:07 dhil

It turns out this is a special case of a more general issue of how Sugartypes rows are translated into Types rows. The translation does not check for duplicate labels. I think in order to fix this issue correctly we first need to fix #681.

dhil avatar Jul 03 '21 08:07 dhil