@@ -27,8 +27,8 @@ object test:
2727 def apply [C , E ]: apply[C , E ] = new apply[C , E ]
2828
2929 class combine [A , B ](
30- val f : Combinator [A ],
31- val s : Combinator [B ] { type Context = f.Context }
30+ tracked val f : Combinator [A ],
31+ tracked val s : Combinator [B ] { type Context = f.Context }
3232 ) extends Combinator [Combine [A , B ]]:
3333 type Context = f.Context
3434 type Element = (f.Element , s.Element )
@@ -38,10 +38,7 @@ object test:
3838 def combine [A , B ](
3939 _f : Combinator [A ],
4040 _s : Combinator [B ] { type Context = _f.Context }
41- ): combine[A , B ] {
42- type Context = _f.Context
43- type Element = (_f.Element , _s.Element )
44- } = new combine[A , B ](_f, _s).asInstanceOf
41+ ) = new combine[A , B ](_f, _s)
4542 // cast is needed since the type of new combine[A, B](_f, _s)
4643 // drops the required refinement.
4744
@@ -56,12 +53,10 @@ object test:
5653 val n = Apply [mutable.ListBuffer [Int ], Int ](s => s.popFirst())
5754 val m = Combine (n, n)
5855
59- val c = combine[
60- Apply [mutable.ListBuffer [Int ], Int ],
61- Apply [mutable.ListBuffer [Int ], Int ]
62- ](
56+ val c = combine(
6357 apply[mutable.ListBuffer [Int ], Int ],
6458 apply[mutable.ListBuffer [Int ], Int ]
6559 )
66- val r = c.parse(m)(stream) // type mismatch, found `mutable.ListBuffer[Int]`, required `?1.Context`
60+ val r = c.parse(m)(stream) // was type mismatch, now OK
61+ val rc : Option [(Int , Int )] = r
6762 }
0 commit comments