File tree 5 files changed +6
-6
lines changed
compiler/src/dotty/tools/dotc 5 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -661,9 +661,6 @@ object Flags {
661
661
/** Is a default parameter in Scala 2*/
662
662
final val DefaultParameter : FlagConjunction = allOf(Param , DefaultParameterized )
663
663
664
- /** A Scala 2 Macro */
665
- final val Scala2Macro : FlagConjunction = allOf(Macro , Scala2x )
666
-
667
664
/** A trait that does not need to be initialized */
668
665
final val NoInitsTrait : FlagConjunction = allOf(Trait , NoInits )
669
666
Original file line number Diff line number Diff line change @@ -807,6 +807,9 @@ object SymDenotations {
807
807
// we need an inline flag on them only do that
808
808
// reduceProjection gets access to their rhs
809
809
810
+ /** Is this a Scala 2 macro */
811
+ final def isScala2Macro (implicit ctx : Context ): Boolean = is(Macro ) && symbol.owner.is(Scala2x )
812
+
810
813
/** An erased value or an inline method, excluding @forceInline annotated methods.
811
814
* The latter have to be kept around to get to parity with Scala.
812
815
* This is necessary at least until we have full bootstrap. Right now
Original file line number Diff line number Diff line change @@ -400,10 +400,10 @@ object RefChecks {
400
400
overrideError(" is an extension method, cannot override a normal method" )
401
401
} else if (other.is(Extension ) && ! member.is(Extension )) { // (1.9.2)
402
402
overrideError(" is a normal method, cannot override an extension method" )
403
- } else if ((member.isInlineMethod || member.is( Scala2Macro ) ) && other.is(Deferred ) &&
403
+ } else if ((member.isInlineMethod || member.isScala2Macro ) && other.is(Deferred ) &&
404
404
member.extendedOverriddenSymbols.forall(_.is(Deferred ))) { // (1.10)
405
405
overrideError(" is an inline method, must override at least one concrete method" )
406
- } else if (other.is( Scala2Macro ) && ! member.is( Scala2Macro ) ) { // (1.11)
406
+ } else if (other.isScala2Macro && ! member.isScala2Macro ) { // (1.11)
407
407
overrideError(" cannot be used here - only Scala-2 macros can override Scala-2 macros" )
408
408
} else if (! compatibleTypes(memberTp(self), otherTp(self)) &&
409
409
! compatibleTypes(memberTp(upwardsSelf), otherTp(upwardsSelf))) {
Original file line number Diff line number Diff line change @@ -2655,7 +2655,7 @@ class Typer extends Namer
2655
2655
tree.tpe <:< wildApprox(pt)
2656
2656
readaptSimplified(Inliner .inlineCall(tree, pt))
2657
2657
}
2658
- else if (tree.symbol.is( Macro , butNot = Inline ) ) {
2658
+ else if (tree.symbol.isScala2Macro ) {
2659
2659
if (ctx.settings.XignoreScala2Macros .value) {
2660
2660
ctx.warning(" Scala 2 macro cannot be used in Dotty. See http://dotty.epfl.ch/docs/reference/dropped-features/macros.html" , tree.sourcePos)
2661
2661
tree
You can’t perform that action at this time.
0 commit comments