Restore source compatibility with Scala 2.11

This commit is contained in:
Martin Duhem 2015-11-04 13:35:53 +01:00
parent 46058029b5
commit efff171618
1 changed files with 6 additions and 1 deletions

View File

@ -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 {