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
Possible bug in self-contained example below due to polymorphic types.
importscala.annotation.targetNameobjectBugExp4Point2D {
sealedtraitColumnType[T]
caseobjectDoubleTextendsColumnType[Double]
caseobjectIntTextendsColumnType[Int]
objectdsl {
extension [T1:Numeric, T2:Numeric](x: T1)
// N - N@targetName("point2DConstant")
defº(y: T2):Point2D[T1,T2] =???// N - C@targetName("point2DConstantData")
defº(y: ColumnType[T2]):Point2D[T1,T2] =???extension [T1:Numeric, T2:Numeric](x: ColumnType[T1])
// C - C@targetName("point2DData")
defº(y: ColumnType[T2]):Point2D[T1,T2] =???// C - N@targetName("point2DDataConstant")
defº(y: T2):Point2D[T1,T2] =???
}
caseclassPoint2D[T1:Numeric, T2:Numeric](x:T1, y:T2)
importdsl._defmain(args: Array[String]):Unit= {
valx=IntTvaly=DoubleTvalpos1:Point2D[Int,Double] = x º y
valpos2:Point2D[Int,Double] =100 º 200.1valpos3:Point2D[Int,Double] =101 º y
valpos4:Point2D[Int,Double] = x º 201.1
}
}
Output
[error] -- [E008] NotFoundError:/home/hhh/IdeaProjects/snol/splotly/src/gg/BugExp4Point2D.scala:55:38
[error] 55|valpos1:Point2D[Int,Double] = x º y
[error] |^^^
[error] | value º is not a member of objectgg.BugExp4Point2D.IntT.
[error] |An extension method was tried, but could not be fully constructed:
[error] |
[error] | º(x)
[error] -- [E008] NotFoundError:/home/hhh/IdeaProjects/snol/splotly/src/gg/BugExp4Point2D.scala:58:38
[error] 58|valpos4:Point2D[Int,Double] = x º 201.1
[error] |^^^
[error] | value º is not a member of objectgg.BugExp4Point2D.IntT.
[error] |An extension method was tried, but could not be fully constructed:
[error] |
[error] | º(x)
Expectation
I expected pos1 and pos4 to be handled correctly just as pos2 and pos3 are.
What is different in pos1 and pos4 is that the first operand uses a polymorphic type parameter.
If it is a bug, any way of circumventing this temporarily?
Tested on M3.
EDIT: Forgot to indicate that if we remove the last extension and pos4, the example compiles correctly.
The text was updated successfully, but these errors were encountered:
Minimized code
Possible bug in self-contained example below due to polymorphic types.
Output
Expectation
I expected
pos1
andpos4
to be handled correctly just aspos2
andpos3
are.What is different in
pos1
andpos4
is that the first operand uses a polymorphic type parameter.If it is a bug, any way of circumventing this temporarily?
Tested on M3.
EDIT: Forgot to indicate that if we remove the last extension and
pos4
, the example compiles correctly.The text was updated successfully, but these errors were encountered: