Possibly unsound unchecked casts
nicolasstucki opened this issue · 3 comments
nicolasstucki commented
There are a couple of casts on Expr
that seem to be unsound. To check those casts use the cast
method.
- term.seal.asInstanceOf[Expr[T]]
+ term.seal.cast[T]
- https://github.com/rssh/dotty-cps-async/blob/master/src/main/scala/cps/forest/application/ApplyArgRecordScope.scala#L199-L200
- https://github.com/rssh/dotty-cps-async/blob/master/src/main/scala/cps/forest/ValDefTransform.scala#L142
Discovered in scala/scala3#9497
rssh commented
Thanks
will switch now.
rssh commented
Converted all, except three entries, which, I guess, show dotty bugs in type comparison.
[will submit separate bug-reports to dotty during the next possible timeslot. For now - those cast-s commented out. ]
nicolasstucki commented
I just saw some other .asInstanceOf[Expr[T]]
that are not after a seal
, those should also use cast[T]