@@ -1694,11 +1694,6 @@ class Namer { typer: Typer =>
16941694 case _ =>
16951695 approxTp
16961696
1697- // println(s"final inherited for $sym: ${inherited.toString}") !!!
1698- // println(s"owner = ${sym.owner}, decls = ${sym.owner.info.decls.show}")
1699- // TODO Scala 3.1: only check for inline vals (no final ones)
1700- def isInlineVal = sym.isOneOf(FinalOrInline , butNot = Method | Mutable )
1701-
17021697 var rhsCtx = ctx.fresh.addMode(Mode .InferringReturnType )
17031698 if sym.isInlineMethod then rhsCtx = rhsCtx.addMode(Mode .InlineableBody )
17041699 if sym.is(ExtensionMethod ) then rhsCtx = rhsCtx.addMode(Mode .InExtensionMethod )
@@ -1732,7 +1727,7 @@ class Namer { typer: Typer =>
17321727 // don't strip @uncheckedVariance annot for default getters
17331728 TypeOps .simplify(tp.widenTermRefExpr,
17341729 if defaultTp.exists then TypeOps .SimplifyKeepUnchecked () else null ) match
1735- case ctp : ConstantType if isInlineVal => ctp
1730+ case ctp : ConstantType if sym. isInlineVal => ctp
17361731 case tp => TypeComparer .widenInferred(tp, pt)
17371732
17381733 // Replace aliases to Unit by Unit itself. If we leave the alias in
@@ -1743,7 +1738,7 @@ class Namer { typer: Typer =>
17431738 def lhsType = fullyDefinedType(cookedRhsType, " right-hand side" , mdef.span)
17441739 // if (sym.name.toString == "y") println(i"rhs = $rhsType, cooked = $cookedRhsType")
17451740 if (inherited.exists)
1746- if ( isInlineVal) lhsType else inherited
1741+ if sym. isInlineVal then lhsType else inherited
17471742 else {
17481743 if (sym.is(Implicit ))
17491744 mdef match {
0 commit comments