`afterPostErasure` didn't exist in 2.9

This commit is contained in:
Martin Duhem 2015-11-04 15:04:59 +01:00
parent efff171618
commit 111511dc6d
1 changed files with 3 additions and 2 deletions

View File

@ -45,11 +45,12 @@ abstract class Compat {
val Nullary = global.NullaryMethodType
val ScalaObjectClass = definitions.ScalaObjectClass
// In 2.11, afterPostErasure has been renamed to exitingPostErasure
// `afterPostErasure` doesn't exist in Scala < 2.10
implicit def withAfterPostErasure(global: Global) = new WithAfterPostErasure(global)
class WithAfterPostErasure(global: Global) {
def afterPostErasure[T](op: => T): T = sourceCompatibilityOnly
def afterPostErasure[T](op: => T): T = op
}
// `exitingPostErasure` was called `afterPostErasure` in 2.10
implicit def withExitingPostErasure(global: Global) = new WithExitingPostErasure(global)
class WithExitingPostErasure(global: Global) {
def exitingPostErasure[T](op: => T): T = global afterPostErasure op