mirror of https://github.com/sbt/sbt.git
Restore compiler bridge source for Scala < 2.10
This commit is contained in:
parent
a93f1e50c8
commit
1ebe86b704
|
|
@ -45,15 +45,10 @@ abstract class Compat {
|
|||
val Nullary = global.NullaryMethodType
|
||||
val ScalaObjectClass = definitions.ScalaObjectClass
|
||||
|
||||
// `afterPostErasure` doesn't exist in Scala < 2.10
|
||||
implicit def withAfterPostErasure(global: Global): WithAfterPostErasure = new WithAfterPostErasure(global)
|
||||
class WithAfterPostErasure(global: Global) {
|
||||
def afterPostErasure[T](op: => T): T = op
|
||||
}
|
||||
// `exitingPostErasure` was called `afterPostErasure` in 2.10
|
||||
implicit def withExitingPostErasure(global: Global): WithExitingPostErasure = new WithExitingPostErasure(global)
|
||||
class WithExitingPostErasure(global: Global) {
|
||||
def exitingPostErasure[T](op: => T): T = global afterPostErasure op
|
||||
// `transformedType` doesn't exist in Scala < 2.10
|
||||
implicit def withTransformedType(global: Global): WithTransformedType = new WithTransformedType(global)
|
||||
class WithTransformedType(global: Global) {
|
||||
def transformedType(tpe: Type): Type = tpe
|
||||
}
|
||||
|
||||
private[this] final class MiscCompat {
|
||||
|
|
|
|||
|
|
@ -277,7 +277,7 @@ class ExtractAPI[GlobalType <: CallbackGlobal](val global: GlobalType,
|
|||
val beforeErasure = makeDef(processType(in, dropConst(returnType)))
|
||||
val afterErasure =
|
||||
if (inspectPostErasure) {
|
||||
val erasedReturn = dropConst(transformedType(viewer(in).memberInfo(s))) map {
|
||||
val erasedReturn = dropConst(global.transformedType(viewer(in).memberInfo(s))) map {
|
||||
case MethodType(_, r) => r
|
||||
case other => other
|
||||
}
|
||||
|
|
@ -288,7 +288,7 @@ class ExtractAPI[GlobalType <: CallbackGlobal](val global: GlobalType,
|
|||
}
|
||||
}
|
||||
def parameterS(erase: Boolean)(s: Symbol): xsbti.api.MethodParameter = {
|
||||
val tp = if (erase) transformedType(s.info) else s.info
|
||||
val tp = if (erase) global.transformedType(s.info) else s.info
|
||||
makeParameter(simpleName(s), tp, tp.typeSymbol, s)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue