Skip to content

Commit 785fe5a

Browse files
committed
Move erasedParams into MethodType
1 parent 4774df5 commit 785fe5a

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3721,8 +3721,6 @@ object Types {
37213721

37223722
def companion: LambdaTypeCompanion[ThisName, PInfo, This]
37233723

3724-
def erasedParams(using Context) = List.fill(paramInfos.size)(false)
3725-
37263724
/** The type `[tparams := paramRefs] tp`, where `tparams` can be
37273725
* either a list of type parameter symbols or a list of lambda parameters
37283726
*
@@ -4019,7 +4017,7 @@ object Types {
40194017
final override def isContextualMethod: Boolean =
40204018
companion.eq(ContextualMethodType)
40214019

4022-
override def erasedParams(using Context): List[Boolean] =
4020+
def erasedParams(using Context): List[Boolean] =
40234021
paramInfos.map(p => p.hasAnnotation(defn.ErasedParamAnnot))
40244022

40254023
def nonErasedParamCount(using Context): Int =

compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,10 @@ class PlainPrinter(_ctx: Context) extends Printer {
297297
"(" ~ toTextRef(tp) ~ " : " ~ toTextGlobal(tp.underlying) ~ ")"
298298

299299
protected def paramsText(lam: LambdaType): Text = {
300-
val erasedParams = lam.erasedParams
301-
def paramText(ref: ParamRef, erased: Boolean) =
300+
def paramText(ref: ParamRef) =
301+
val erased = ref.underlying.hasAnnotation(defn.ErasedParamAnnot)
302302
keywordText("erased ").provided(erased) ~ ParamRefNameString(ref) ~ lambdaHash(lam) ~ toTextRHS(ref.underlying, isParameter = true)
303-
Text(lam.paramRefs.lazyZip(erasedParams).map(paramText), ", ")
303+
Text(lam.paramRefs.map(paramText), ", ")
304304
}
305305

306306
protected def ParamRefNameString(name: Name): String = nameString(name)

0 commit comments

Comments
 (0)