You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
objectBug {
def (ab: (A, B)) pipe2[A, B, Z](f: (A, B) =>Z):Z= f(ab._1, ab._2)
def (a: A) leftErr[A, B](b: B):A= (a, b).pipe2((a, b) => a) //Doesn't compiledef (a: A) leftOk1[A, B](b: B):A=Tuple2(a, b).pipe2((a, b) => a) //Compilesdef (a: A) leftOk2[A, B](b: B):A= {
valt= (a, b)
t.pipe2((a, b) => a) //Compiles
}
}
Error:
[error] -- [E007] Type Mismatch Error: D:\DevProjects\Incubating\Squeal\squeal\src\main\scala\squeal\TupleBug.scala:7:50
[error] 7 | def (a: A) leftErr[A, B](b: B): A = (a, b).pipe2((a, b) => a)
[error] | ^^^^^^^^^^^^^^^^^^^^^^^^^
[error] | Found: Any
[error] | Required: A
expectation
I would expect that all three would work. In most cases I can inline a val without any types without changing the behavior of the program.
The text was updated successfully, but these errors were encountered:
Suppress interpolation in the middle of an ExtMethodApply. The reason is that
the ExtMethodApply has a WildcardType, which hides information about bound type
variables in the result type.
minimized code
Error:
expectation
I would expect that all three would work. In most cases I can inline a val without any types without changing the behavior of the program.
The text was updated successfully, but these errors were encountered: