File tree Expand file tree Collapse file tree 4 files changed +10
-2
lines changed
parser-typechecker/src/Unison/KindInference Expand file tree Collapse file tree 4 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ typeConstraintTree resultVar
[email protected] {annotation, out} = do
101101 restConstraints <- typeConstraintTree resultVar b
102102 pure $ Node [effConstraints, restConstraints]
103103 Type. Effects effs -> do
104- Node <$> for effs \ eff -> do
104+ ParentConstraint ( IsAbility resultVar ( Provenance EffectsList annotation)) . Node <$> for effs \ eff -> do
105105 effKind <- freshVar eff
106106 effConstraints <- typeConstraintTree effKind eff
107107 pure $ ParentConstraint (IsAbility effKind (Provenance EffectsList $ ABT. annotation eff)) effConstraints
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ structural ability Foo where
33 foo : {Foo} Nat
44
55structural type Wrap a = Wrap Nat
6+ structural type C = C (Wrap {}) -- constrain Wrap kind
67
78blah : Wrap {Foo} -> Nat
89blah = cases
Original file line number Diff line number Diff line change @@ -15,6 +15,9 @@ structural type W es = W
1515unique ability Zoot where
1616 zoot : ()
1717
18+ -- here only to put a kind constraint on W
19+ structural type C = C (W {})
20+
1821woot : W {g} -> '{g, Zoot} a ->{Zoot} a
1922woot w a = todo ()
2023
Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ structural type W es = W
1010unique ability Zoot where
1111 zoot : ()
1212
13+ -- here only to put a kind constraint on W
14+ structural type C = C (W {})
15+
1316woot : W {g} -> '{g, Zoot} a ->{Zoot} a
1417woot w a = todo ()
1518
@@ -36,6 +39,7 @@ w2 = cases W -> W
3639
3740 ⍟ These new definitions are ok to `add`:
3841
42+ structural type C
3943 structural type W es
4044 ability Zoot
4145 ex : '{Zoot} r
@@ -46,7 +50,7 @@ w2 = cases W -> W
4650 Now evaluating any watch expressions (lines starting with
4751 `>`)... Ctrl+C cancels.
4852
49- 19 | > w2 w1
53+ 22 | > w2 w1
5054 ⧩
5155 W
5256
You can’t perform that action at this time.
0 commit comments