@@ -10,6 +10,7 @@ import NameOps.*
10
10
import Annotations .Annotation
11
11
import typer .ProtoTypes .constrained
12
12
import ast .{tpd , untpd }
13
+
13
14
import util .Property
14
15
import util .Spans .Span
15
16
import config .Printers .derive
@@ -644,7 +645,7 @@ class SyntheticMembers(thisPhase: DenotTransformer) {
644
645
synthesizeDef(meth, vrefss => body(cls, vrefss.head.head))
645
646
}
646
647
}
647
- def overrideMethod (name : TermName , info : Type , cls : Symbol , body : (Symbol , Tree ) => Context ?=> Tree ): Unit = { // TODO online override if changed
648
+ def overrideMethod (name : TermName , info : Type , cls : Symbol , body : (Symbol , Tree ) => Context ?=> Tree ): Unit = {
648
649
val meth = newSymbol(clazz, name, Synthetic | Method | Override , info, coord = clazz.coord)
649
650
meth.enteredAfter(thisPhase)
650
651
newBody = newBody :+ synthesizeExperimentalDef(meth, vrefss => body(cls, vrefss.head.head))
@@ -666,8 +667,9 @@ class SyntheticMembers(thisPhase: DenotTransformer) {
666
667
addParent(defn.Mirror_ProductClass .typeRef)
667
668
addMethod(nme.fromProduct, MethodType (defn.ProductClass .typeRef :: Nil , monoType.typeRef), cls,
668
669
fromProductBody(_, _, optInfo).ensureConforms(monoType.typeRef)) // t4758.scala or i3381.scala are examples where a cast is needed
669
- if cls.mirrorSupportsDefaultArguments && cls.primaryConstructor.hasDefaultParams then overrideMethod(
670
- nme.defaultArgument, MethodType (defn.IntType :: Nil , defn.AnyType ), cls, defaultArgumentBody(_, _, optInfo))
670
+ if cls.mirrorSupportsDefaultArguments && cls.primaryConstructor.hasDefaultParams then
671
+ overrideMethod(nme.defaultArgument, MethodType (defn.IntType :: Nil , defn.AnyType ), cls,
672
+ defaultArgumentBody(_, _, optInfo))
671
673
}
672
674
def makeSumMirror (cls : Symbol , optInfo : Option [MirrorImpl .OfSum ]) = {
673
675
addParent(defn.Mirror_SumClass .typeRef)
0 commit comments