- Notifications
You must be signed in to change notification settings - Fork 1.1k
Labels
area:overloadingitype:bugneeds-minor-releaseThis PR cannot be merged until the next minor releaseThis PR cannot be merged until the next minor releasestat:wontfix
Description
This regression in 3.4.1 first caused me to chase down the wrong rabbit hole of #19955, so it could be related somehow, but I doubt it.
This is a very weird bug, that can disappear if we remove one of the following:
- Remove the
def ^^^ : Unit = ??? - Remove the
(using check: c.OutW =:= c.OutW)from the thirddef ^^^declaration
The third^^^definition should not be considered for overloading at all because the first one is the more specific.
The error also disappear if we split x ^^^ x ^^^ x into two separate vals.
Compiler version
Last good release: 3.4.1-RC1-bin-20240126-1716bcd-NIGHTLY
First bad release: 3.4.1-RC1-bin-20240129-b20747d-NIGHTLY
bisect: cce2933 in #19096
Minimized code
trait Summon[R, T <: R]: type Out object Summon: given [R, T <: R]: Summon[R, T] with type Out = R sealed class Modifier[+A, +P] type ModifierAny = Modifier[Any, Any] sealed trait ISCONST[T <: Boolean] type CONST = ISCONST[true] trait DFTypeAny trait DFBits[W <: Int] extends DFTypeAny trait DFVal[+T <: DFTypeAny, +M <: ModifierAny] type DFValAny = DFVal[DFTypeAny, ModifierAny] type DFValTP[+T <: DFTypeAny, +P] = DFVal[T, Modifier[Any, P]] type DFConstOf[+T <: DFTypeAny] = DFVal[T, Modifier[Any, CONST]] trait Candidate[R]: type OutW <: Int type OutP object Candidate: given [W <: Int, P, R <: DFValTP[DFBits[W], P]]: Candidate[R] with type OutW = W type OutP = P extension [L <: DFValAny](lhs: L)(using icL: Candidate[L]) def ^^^[R](rhs: R)(using icR: Candidate[R] ): DFValTP[DFBits[icL.OutW], icL.OutP | icR.OutP] = ??? def ^^^ : Unit = ??? extension [L](lhs: L) def ^^^[RW <: Int, RP]( rhs: DFValTP[DFBits[RW], RP] )(using es: Summon[L, lhs.type])(using c: Candidate[L] )(using check: c.OutW =:= c.OutW): DFValTP[DFBits[c.OutW], c.OutP | RP] = ??? val x: DFConstOf[DFBits[8]] = ??? val zzz = x ^^^ x ^^^ xOutput
|val zzz = x ^^^ x ^^^ x | ^ |No given instance of type Summon[DFValTP[DFBits[?1.OutW], ?2.OutP | ISCONST[(true : Boolean)]], | (?3 : DFValTP[DFBits[?1.OutW], ?2.OutP | ISCONST[(true : Boolean)]])] was found for parameter es of method ^^^. |I found: | | Summon.given_Summon_R_T[R, T] | |But given instance given_Summon_R_T in object Summon does not match type Summon[DFValTP[DFBits[?1.OutW], ?2.OutP | ISCONST[(true : Boolean)]], | (?3 : DFValTP[DFBits[?1.OutW], ?2.OutP | ISCONST[(true : Boolean)]])] | |where: ?1 is an unknown value of type Candidate.given_Candidate_R[(8 : Int), ISCONST[(true : Boolean)], | DFVal[DFBits[(8 : Int)], Modifier[Any, CONST]]] | ?2 is an unknown value of type Candidate.given_Candidate_R[(8 : Int), ISCONST[(true : Boolean)], | DFVal[DFBits[(8 : Int)], Modifier[Any, CONST]]] | ?3 is an unknown value of type DFValTP[DFBits[?1.OutW], ?2.OutP | ISCONST[(true : Boolean)]]Expectation
No error.
He-Pin
Metadata
Metadata
Assignees
Labels
area:overloadingitype:bugneeds-minor-releaseThis PR cannot be merged until the next minor releaseThis PR cannot be merged until the next minor releasestat:wontfix