diff options
author | Martin Odersky <odersky@gmail.com> | 2017-01-31 18:04:21 +1100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2017-01-31 18:04:28 +1100 |
commit | 4b961f8d2f62a83988da68f293c66dec8e44f369 (patch) | |
tree | f95ab714575fa81a62be9b1b5c0967a185291b68 /compiler | |
parent | d087448fdffff8f64a23d9db39445455cddc2fc6 (diff) | |
download | dotty-4b961f8d2f62a83988da68f293c66dec8e44f369.tar.gz dotty-4b961f8d2f62a83988da68f293c66dec8e44f369.tar.bz2 dotty-4b961f8d2f62a83988da68f293c66dec8e44f369.zip |
Fix #1916 - fix erasure of xxl closures
xxl closures need to get the SAM type FunctionXXL as their explicit
type field after ersure.
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/src/dotty/tools/dotc/transform/Erasure.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/src/dotty/tools/dotc/transform/Erasure.scala b/compiler/src/dotty/tools/dotc/transform/Erasure.scala index 71ecb5c65..00abddd91 100644 --- a/compiler/src/dotty/tools/dotc/transform/Erasure.scala +++ b/compiler/src/dotty/tools/dotc/transform/Erasure.scala @@ -542,7 +542,9 @@ object Erasure extends TypeTestsCasts{ * to deal with boxing and unboxing of value classes ourselves. */ override def typedClosure(tree: untpd.Closure, pt: Type)(implicit ctx: Context) = { - val implClosure @ Closure(_, meth, _) = super.typedClosure(tree, pt) + val xxl = defn.isUnimplementedFunctionClass(tree.typeOpt.typeSymbol) + var implClosure @ Closure(_, meth, _) = super.typedClosure(tree, pt) + if (xxl) implClosure = cpy.Closure(implClosure)(tpt = TypeTree(defn.FunctionXXLType)) implClosure.tpe match { case SAMType(sam) => val implType = meth.tpe.widen |