Skip to content

Commit 1eb0fba

Browse files
committed
Remove uses of the @bridge annotation in compiler.
Because I can't remove the annotation until reSTARR
1 parent 3545196 commit 1eb0fba

File tree

6 files changed

+4
-10
lines changed

6 files changed

+4
-10
lines changed

src/compiler/scala/tools/nsc/typechecker/Infer.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ trait Infer extends Checkable {
5858
def improves(sym1: Symbol, sym2: Symbol) = (
5959
(sym2 eq NoSymbol)
6060
|| sym2.isError
61-
|| (sym2 hasAnnotation BridgeClass)
6261
|| isBetter(sym1, sym2)
6362
)
6463

src/compiler/scala/tools/nsc/typechecker/RefChecks.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ abstract class RefChecks extends Transform {
550550
}
551551

552552
def checkOverrideDeprecated() {
553-
if (other.hasDeprecatedOverridingAnnotation && !(member.hasDeprecatedOverridingAnnotation || member.ownerChain.exists(x => x.isDeprecated || x.hasBridgeAnnotation))) {
553+
if (other.hasDeprecatedOverridingAnnotation && !(member.hasDeprecatedOverridingAnnotation || member.ownerChain.exists(_.isDeprecated))) {
554554
val version = other.deprecatedOverridingVersion.getOrElse("")
555555
val since = if (version.isEmpty) version else s" (since $version)"
556556
val message = other.deprecatedOverridingMessage map (msg => s": $msg") getOrElse ""
@@ -1235,8 +1235,7 @@ abstract class RefChecks extends Transform {
12351235
private def checkUndesiredProperties(sym: Symbol, pos: Position) {
12361236
// If symbol is deprecated, and the point of reference is not enclosed
12371237
// in either a deprecated member or a scala bridge method, issue a warning.
1238-
// TODO: x.hasBridgeAnnotation doesn't seem to be needed here...
1239-
if (sym.isDeprecated && !currentOwner.ownerChain.exists(x => x.isDeprecated || x.hasBridgeAnnotation))
1238+
if (sym.isDeprecated && !currentOwner.ownerChain.exists(x => x.isDeprecated))
12401239
currentRun.reporting.deprecationWarning(pos, sym)
12411240

12421241
// Similar to deprecation: check if the symbol is marked with @migration

src/compiler/scala/tools/nsc/typechecker/Typers.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1751,7 +1751,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
17511751
val sameSourceFile = context.unit.source.file == psym.sourceFile
17521752

17531753
if (!isPastTyper && psym.hasDeprecatedInheritanceAnnotation &&
1754-
!sameSourceFile && !context.owner.ownerChain.exists(x => x.isDeprecated || x.hasBridgeAnnotation)) {
1754+
!sameSourceFile && !context.owner.ownerChain.exists(_.isDeprecated)) {
17551755
val version = psym.deprecatedInheritanceVersion.getOrElse("")
17561756
val since = if (version.isEmpty) version else s" (since $version)"
17571757
val message = psym.deprecatedInheritanceMessage.map(msg => s": $msg").getOrElse("")
@@ -3147,8 +3147,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
31473147
&& (inBlock || !(sym.isMethod || sym1.isMethod) || (sym.tpe matches sym1.tpe))
31483148
// default getters are defined twice when multiple overloads have defaults.
31493149
// The error for this is deferred until RefChecks.checkDefaultsInOverloaded
3150-
&& (!sym.isErroneous && !sym1.isErroneous && !sym.hasDefault &&
3151-
!sym.hasAnnotation(BridgeClass) && !sym1.hasAnnotation(BridgeClass))) {
3150+
&& !sym.isErroneous && !sym1.isErroneous && !sym.hasDefault) {
31523151
log("Double definition detected:\n " +
31533152
((sym.getClass, sym.info, sym.ownerChain)) + "\n " +
31543153
((sym1.getClass, sym1.info, sym1.ownerChain)))

src/reflect/scala/reflect/internal/Definitions.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,6 @@ trait Definitions extends api.StandardDefinitions {
11191119
lazy val AnnotationRetentionPolicyAttr = requiredClass[java.lang.annotation.RetentionPolicy]
11201120

11211121
// Annotations
1122-
lazy val BridgeClass = requiredClass[scala.annotation.bridge]
11231122
lazy val ElidableMethodClass = requiredClass[scala.annotation.elidable]
11241123
lazy val ImplicitNotFoundClass = requiredClass[scala.annotation.implicitNotFound]
11251124
lazy val ImplicitAmbiguousClass = getClassIfDefined("scala.annotation.implicitAmbiguous")

src/reflect/scala/reflect/internal/Symbols.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,6 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
900900

901901
def isStrictFP = hasAnnotation(ScalaStrictFPAttr) || (enclClass hasAnnotation ScalaStrictFPAttr)
902902
def isSerializable = info.baseClasses.exists(p => p == SerializableClass || p == JavaSerializableClass)
903-
def hasBridgeAnnotation = hasAnnotation(BridgeClass)
904903
def isDeprecated = hasAnnotation(DeprecatedAttr)
905904
def deprecationMessage = getAnnotation(DeprecatedAttr) flatMap (_ stringArg 0)
906905
def deprecationVersion = getAnnotation(DeprecatedAttr) flatMap (_ stringArg 1)

src/reflect/scala/reflect/runtime/JavaUniverseForce.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,6 @@ trait JavaUniverseForce { self: runtime.JavaUniverse =>
378378
definitions.StaticAnnotationClass
379379
definitions.AnnotationRetentionAttr
380380
definitions.AnnotationRetentionPolicyAttr
381-
definitions.BridgeClass
382381
definitions.ElidableMethodClass
383382
definitions.ImplicitNotFoundClass
384383
definitions.ImplicitAmbiguousClass

0 commit comments

Comments
 (0)