File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
src/dotty/tools/dotc/transform Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,10 @@ object Erasure {
133
133
134
134
/** Generate a synthetic cast operation from tree.tpe to pt.
135
135
*/
136
- def cast (tree : Tree , pt : Type )(implicit ctx : Context ): Tree =
136
+ def cast (tree : Tree , pt : Type )(implicit ctx : Context ): Tree = {
137
+ // TODO: The commented out assertion fails for tailcall/t6574.scala
138
+ // Fix the problem and enable the assertion.
139
+ // assert(!pt.isInstanceOf[SingletonType], pt)
137
140
if (pt isRef defn.UnitClass ) unbox(tree, pt)
138
141
else (tree.tpe, pt) match {
139
142
case (defn.ArrayType (treeElem), defn.ArrayType (ptElem))
@@ -144,6 +147,7 @@ object Erasure {
144
147
ctx.log(s " casting from ${tree.showSummary}: ${tree.tpe.show} to ${pt.show}" )
145
148
mkAsInstanceOf(tree, pt)
146
149
}
150
+ }
147
151
148
152
/** Adaptation of an expression `e` to an expected type `PT`, applying the following
149
153
* rewritings exhaustively as long as the type of `e` is not a subtype of `PT`.
You can’t perform that action at this time.
0 commit comments