Skip to content

Commit d200a4b

Browse files
committed
Various clean ups
1 parent 3c899d2 commit d200a4b

File tree

5 files changed

+6
-8
lines changed

5 files changed

+6
-8
lines changed

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -1843,7 +1843,6 @@ object Types {
18431843
(if mt.isErasedMethod && !ctx.erasedTypes then
18441844
mt.companion.asInstanceOf[ErasedMethodCompanion].isErased
18451845
else List.fill(mt.paramInfos.size) { false }) dropRight dropLast
1846-
// println(s"$mt => $isErased")
18471846
val result1 = mt.nonDependentResultApprox match {
18481847
case res: MethodType => res.toFunctionType(isJava)
18491848
case res => res
@@ -4038,7 +4037,7 @@ object Types {
40384037

40394038
object MethodType extends MethodTypeCompanion("MethodType") {
40404039
def companion(isContextual: Boolean = false, isImplicit: Boolean = false, isErased: List[Boolean] = List()): MethodTypeCompanion =
4041-
val hasErased = isErased.exists(_ == true)
4040+
val hasErased = isErased.contains(true)
40424041
if (isContextual)
40434042
if (hasErased) ErasedContextualMethodType(isErased) else ContextualMethodType
40444043
else if (isImplicit)

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -1496,7 +1496,7 @@ object Parsers {
14961496
if isByNameType(tpt) then
14971497
syntaxError(em"parameter of type lambda may not be call-by-name", tpt.span)
14981498
TermLambdaTypeTree(params.asInstanceOf[List[ValDef]], resultType)
1499-
else if imods.isOneOf(Given | Impure) || erasedArgs.exists(_ == true) then
1499+
else if imods.isOneOf(Given | Impure) || erasedArgs.contains(true) then
15001500
if imods.is(Given) && params.isEmpty then
15011501
syntaxError(em"context function types require at least one parameter", paramSpan)
15021502
FunctionWithMods(params, resultType, imods, erasedArgs.toList)
@@ -1597,7 +1597,7 @@ object Parsers {
15971597
erasedArgs.addOne(false)
15981598
functionRest(t :: Nil)
15991599
else
1600-
if (erasedArgs.exists(_ == true) && !t.isInstanceOf[FunctionWithMods])
1600+
if (erasedArgs.contains(true) && !t.isInstanceOf[FunctionWithMods])
16011601
syntaxError(ErasedTypesCanOnlyBeFunctionTypes(), implicitKwPos(start))
16021602
t
16031603
end typ

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
159159
"("
160160
~ argsText(args.init)
161161
~ ")"
162-
argStr ~ " " ~ arrow(isGiven, isPure) ~ " " ~ argText(args.last, false)
162+
argStr ~ " " ~ arrow(isGiven, isPure) ~ " " ~ argText(args.last)
163163
}
164164

165165
def toTextMethodAsFunction(info: Type, isPure: Boolean): Text = info match

compiler/src/dotty/tools/dotc/transform/ContextFunctionResults.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ object ContextFunctionResults:
7474
tp.derivedLambdaType(resType = integrateContextResults(tp.resType, crCount))
7575
case defn.ContextFunctionType(argTypes, resType, isErased) =>
7676
val methodType: MethodTypeCompanion =
77-
if isErased.exists(_ == true) then ErasedMethodType(isErased) else MethodType
77+
if isErased.contains(true) then ErasedMethodType(isErased) else MethodType
7878
methodType(argTypes, integrateContextResults(resType, crCount - 1))
7979

8080
/** The total number of parameters of method `sym`, not counting
@@ -87,7 +87,7 @@ object ContextFunctionResults:
8787
else
8888
val defn.ContextFunctionType(params, resTpe, isErased) = tp: @unchecked
8989
val rest = contextParamCount(resTpe, crCount - 1)
90-
if isErased.exists(_ == true) then isErased.count(_ == false) + rest else params.length + rest
90+
if isErased.contains(true) then isErased.count(_ == false) + rest else params.length + rest
9191

9292
def normalParamCount(tp: Type): Int = tp.widenExpr.stripPoly match
9393
case mt @ MethodType(pnames) =>

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

-1
Original file line numberDiff line numberDiff line change
@@ -1448,7 +1448,6 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
14481448
// companion.isErased
14491449
case _ => params.map(_ => false)
14501450
}
1451-
// println(s"callee type = ${calleeType.widen}")
14521451

14531452
pt match {
14541453
case pt: TypeVar

0 commit comments

Comments
 (0)