Skip to content

Commit 4d9ef0d

Browse files
Apply suggestions from code review
Co-authored-by: Nicolas Stucki <nicolas.stucki@gmail.com>
1 parent 28920fd commit 4d9ef0d

File tree

5 files changed

+4
-5
lines changed

5 files changed

+4
-5
lines changed

compiler/src/dotty/tools/dotc/ast/untpd.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
7676
override def isType: Boolean = body.isType
7777
}
7878

79-
/** A function type or closure with `implicit`, `erased`, or `given` modifiers */
79+
/** A function type or closure with `implicit` or `given` modifiers and information on which parameters are `erased` */
8080
class FunctionWithMods(args: List[Tree], body: Tree, val mods: Modifiers, val erasedParams: List[Boolean])(implicit @constructorOnly src: SourceFile)
8181
extends Function(args, body) {
8282
assert(args.length == erasedParams.length)

compiler/src/dotty/tools/dotc/core/tasty/TastyPrinter.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ class TastyPrinter(bytes: Array[Byte]) {
136136
case METHODtype | POLYtype | TYPELAMBDAtype =>
137137
printTree()
138138
while (currentAddr.index < end.index && !isModifierTag(nextByte)) { printTree(); printName(); }
139-
// read tags
140139
printTrees()
141140
case PARAMtype =>
142141
printNat(); printNat()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class PlainPrinter(_ctx: Context) extends Printer {
129129
* (hence with `GlobalPrec` precedence).
130130
*/
131131
protected def argsText(args: List[Type]): Text =
132-
atPrec(GlobalPrec) { Text(args.map(argText(_)), ", ") }
132+
atPrec(GlobalPrec) { Text(args.map(arg => argText(arg) ), ", ") }
133133

134134
/** The longest sequence of refinement types, starting at given type
135135
* and following parents.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ object ContextFunctionResults:
5858
*/
5959
def contextResultsAreErased(sym: Symbol)(using Context): Boolean =
6060
def allErased(tp: Type): Boolean = tp.dealias match
61-
case defn.ContextFunctionType(_, resTpe, erasedParams) => erasedParams.forall(_ == true) && allErased(resTpe)
61+
case defn.ContextFunctionType(_, resTpe, erasedParams) => !erasedParams.contains(false) && allErased(resTpe)
6262
case _ => true
6363
contextResultCount(sym) > 0 && allErased(sym.info.finalResultType)
6464

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class SpecializeFunctions extends MiniPhase {
7070
/** Dispatch to specialized `apply`s in user code when available */
7171
override def transformApply(tree: Apply)(using Context) =
7272
tree match {
73-
case Apply(fun: NameTree, args) if fun.name == nme.apply && args.size <= 3 && fun.symbol.exists && fun.symbol.owner.isType =>
73+
case Apply(fun: NameTree, args) if fun.name == nme.apply && args.size <= 3 && fun.symbol.maybeOwner.isType =>
7474
val argTypes = fun.tpe.widen.firstParamTypes.map(_.widenSingleton.dealias)
7575
val retType = tree.tpe.widenSingleton.dealias
7676
val isSpecializable =

0 commit comments

Comments
 (0)