Skip to content

Regression in getkyo/kyo for typer #20297

Closed
@WojciechMazur

Description

@WojciechMazur

Based on OpenCB failure in getkyo/kyo - build logs

Compiler version

Last good release: 3.4.2-RC1-bin-20240311-02c2a6e-NIGHTLY
First bad release: 3.4.2-RC1-bin-20240312-3694d95-NIGHTLY
Exact bisect has failed due to errors when building compiler, could be caused by any of:
b28d4c1
2421581

Minimized code

sealed abstract class Kyo[+T, -S]
opaque type <[+T, -S] >: T = T | Kyo[T, S]

extension [T, S](v: T < S)
  inline def map[U, S2](inline f: T => U < S2): U < (S & S2) = ???

class Streams[V]
object Streams:
  def emitValue[V](v: V): Unit < Streams[V] = ???

opaque type Stream[+T, V, -S] = T < (Streams[V] & S)
object Stream:
  extension [T, V, S](s: Stream[T, V, S])
    def reemit[S2, V2](f: V => Unit < (Streams[V2] & S2)): Stream[T, V2, S & S2] = ???
    def filter[S2](f: V => Boolean < S2): Stream[T, V, S & S2] = reemit { v =>
      f(v).map {
        case false => ()
        case true  => Streams.emitValue(v)
      }
    }

Output

-- [E007] Type Mismatch Error: /Users/wmazur/projects/dotty/bisect/test.scala:18:39 
18 |        case true  => Streams.emitValue(v)
   |                      ^^^^^^^^^^^^^^^^^^^^
   |                      Found:    Unit < Streams[V]
   |                      Required: Unit < (S & S2)
   |

Expectation

Should compile

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions