unison/unison-src/tests/ungeneralize-bug.uu
2021-08-24 11:33:27 -07:00

23 lines
570 B
Plaintext

use Foo Foo
use Optional Some None
structural type Foo a b = Foo a (Optional b)
foo : Foo a b -> (b -> c) -> Foo a c
foo x f = match x with
Foo a None -> Foo a None
--
-- 🌻 /Users/pchiusano/work/unison/unison-src/tests/typechecker-bug.u has changed, reloading...
-- I found a value of type b where I expected to find one of type c:
--
-- 7 | foo : Foo a b -> (b -> c) -> Foo a c
-- 8 | foo x f = match x with
-- 9 | Foo a None -> Foo a None
--
-- from right here:
--
-- 7 | foo : Foo a b -> (b -> c) -> Foo a c
-- shouldn't be a type error