Skip to content

Commit 6445f85

Browse files
committed
Remove rewrite annotation again
With the Scala 2/3 split, we don't need it anymore.
1 parent 9b42eca commit 6445f85

File tree

3 files changed

+5
-21
lines changed

3 files changed

+5
-21
lines changed

compiler/src/dotty/tools/dotc/core/Definitions.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -740,8 +740,6 @@ class Definitions {
740740
def ImplicitNotFoundAnnot(implicit ctx: Context) = ImplicitNotFoundAnnotType.symbol.asClass
741741
lazy val ForceInlineAnnotType = ctx.requiredClassRef("scala.forceInline")
742742
def ForceInlineAnnot(implicit ctx: Context) = ForceInlineAnnotType.symbol.asClass
743-
lazy val RewriteAnnotType = ctx.requiredClassRef("scala.rewrite")
744-
def RewriteAnnot(implicit ctx: Context) = RewriteAnnotType.symbol.asClass
745743
lazy val TransparentParamAnnotType = ctx.requiredClassRef("scala.annotation.internal.TransparentParam")
746744
def TransparentParamAnnot(implicit ctx: Context) = TransparentParamAnnotType.symbol.asClass
747745
lazy val InvariantBetweenAnnotType = ctx.requiredClassRef("scala.annotation.internal.InvariantBetween")
@@ -1231,6 +1229,9 @@ class Definitions {
12311229

12321230
private[this] var isInitialized = false
12331231

1232+
/** Add a `Tuple` as a parent to `Unit`.
1233+
* Add the right `*:` instance as a parent to Tuple1..Tuple22
1234+
*/
12341235
def fixTupleCompleter(cls: ClassSymbol): Unit = cls.infoOrCompleter match {
12351236
case completer: LazyType =>
12361237
cls.info = new LazyType {
@@ -1268,7 +1269,7 @@ class Definitions {
12681269

12691270
fixTupleCompleter(UnitClass)
12701271
for (i <- 1 to MaxTupleArity)
1271-
fixTupleCompleter(TupleType(i).symbol.asClass)
1272+
fixTupleCompleter(TupleType(i).symbol.asClass)
12721273

12731274
isInitialized = true
12741275
}

compiler/src/dotty/tools/dotc/typer/Namer.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -753,8 +753,7 @@ class Namer { typer: Typer =>
753753
val cls = typedAheadAnnotationClass(annotTree)(annotCtx)
754754
val ann = Annotation.deferred(cls, implicit ctx => typedAnnotation(annotTree))
755755
sym.addAnnotation(ann)
756-
if ((cls == defn.ForceInlineAnnot || cls == defn.RewriteAnnot) &&
757-
sym.is(Method, butNot = Accessor))
756+
if (cls == defn.ForceInlineAnnot && sym.is(Method, butNot = Accessor))
758757
sym.setFlag(Rewrite)
759758
}
760759
case _ =>

library/src/scala/rewrite.scala

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)