From efff1716185b68135083ca59ea5506b2c25b915e Mon Sep 17 00:00:00 2001 From: Martin Duhem Date: Wed, 4 Nov 2015 13:35:53 +0100 Subject: [PATCH] Restore source compatibility with Scala 2.11 --- compile/interface/src/main/scala/xsbt/Compat.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/compile/interface/src/main/scala/xsbt/Compat.scala b/compile/interface/src/main/scala/xsbt/Compat.scala index 016658238..2c7331100 100644 --- a/compile/interface/src/main/scala/xsbt/Compat.scala +++ b/compile/interface/src/main/scala/xsbt/Compat.scala @@ -45,9 +45,14 @@ abstract class Compat { val Nullary = global.NullaryMethodType val ScalaObjectClass = definitions.ScalaObjectClass + // In 2.11, afterPostErasure has been renamed to exitingPostErasure + implicit def withAfterPostErasure(global: Global) = new WithAfterPostErasure(global) + class WithAfterPostErasure(global: Global) { + def afterPostErasure[T](op: => T): T = sourceCompatibilityOnly + } implicit def withExitingPostErasure(global: Global) = new WithExitingPostErasure(global) class WithExitingPostErasure(global: Global) { - def exitingPostErasure[T](op: => T) = global afterPostErasure op + def exitingPostErasure[T](op: => T): T = global afterPostErasure op } private[this] final class MiscCompat {