Skip to content

Commit 43160dd

Browse files
authored
Merge branch 'lampepfl:main' into fix/11022
2 parents 3a21949 + 824295e commit 43160dd

File tree

63 files changed

+1096
-203
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1096
-203
lines changed

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

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,10 @@ class TreeMapWithImplicits extends tpd.TreeMapWithPreciseStatContexts {
3030

3131
private def patternScopeCtx(pattern: Tree)(using Context): Context = {
3232
val nestedCtx = ctx.fresh.setNewScope
33-
new TreeTraverser {
34-
def traverse(tree: Tree)(using Context): Unit = {
35-
tree match {
36-
case d: DefTree if d.symbol.isOneOf(GivenOrImplicitVal) =>
37-
nestedCtx.enter(d.symbol)
38-
case _ =>
39-
}
40-
traverseChildren(tree)
41-
}
42-
}.traverse(pattern)
33+
pattern.foreachSubTree {
34+
case d: DefTree if d.symbol.isOneOf(GivenOrImplicitVal) => nestedCtx.enter(d.symbol)
35+
case _ =>
36+
}
4337
nestedCtx
4438
}
4539

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -855,9 +855,9 @@ object Trees {
855855
}
856856

857857
/** extends parents { self => body }
858-
* @param parentsOrDerived A list of parents followed by a list of derived classes,
859-
* if this is of class untpd.DerivingTemplate.
860-
* Typed templates only have parents.
858+
* @param preParentsOrDerived A list of parents followed by a list of derived classes,
859+
* if this is of class untpd.DerivingTemplate.
860+
* Typed templates only have parents.
861861
*/
862862
case class Template[+T <: Untyped] private[ast] (constr: DefDef[T], private var preParentsOrDerived: LazyTreeList[T], self: ValDef[T], private var preBody: LazyTreeList[T])(implicit @constructorOnly src: SourceFile)
863863
extends DefTree[T] with WithLazyFields {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1548,7 +1548,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
15481548
*
15491549
* @param trees the elements the list represented by
15501550
* the resulting tree should contain.
1551-
* @param tpe the type of the elements of the resulting list.
1551+
* @param tpt the type of the elements of the resulting list.
15521552
*
15531553
*/
15541554
def mkList(trees: List[Tree], tpt: Tree)(using Context): Tree =

compiler/src/dotty/tools/dotc/config/Feature.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ object Feature:
2929
val fewerBraces = experimental("fewerBraces")
3030
val saferExceptions = experimental("saferExceptions")
3131
val clauseInterleaving = experimental("clauseInterleaving")
32+
val relaxedExtensionImports = experimental("relaxedExtensionImports")
3233
val pureFunctions = experimental("pureFunctions")
3334
val captureChecking = experimental("captureChecking")
3435
val into = experimental("into")

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1509,7 +1509,6 @@ class Definitions {
15091509

15101510
/** Is an context function class.
15111511
* - ContextFunctionN for N >= 0
1512-
* - ErasedContextFunctionN for N > 0
15131512
*/
15141513
def isContextFunctionClass(cls: Symbol): Boolean = scalaClassName(cls).isContextFunction
15151514

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,9 +1407,9 @@ object SymDenotations {
14071407
case Nil => Iterator.empty
14081408
}
14091409

1410-
/** The symbol overriding this symbol in given subclass `ofclazz`.
1410+
/** The symbol overriding this symbol in given subclass `inClass`.
14111411
*
1412-
* @param ofclazz is a subclass of this symbol's owner
1412+
* @pre `inClass` is a subclass of this symbol's owner
14131413
*/
14141414
final def overridingSymbol(inClass: ClassSymbol)(using Context): Symbol =
14151415
if (canMatchInheritedSymbols) matchingDecl(inClass, inClass.thisType)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ object Symbols {
4040
val Ids: Property.Key[Array[String]] = new Property.Key
4141

4242
/** A Symbol represents a Scala definition/declaration or a package.
43-
* @param coord The coordinates of the symbol (a position or an index)
43+
* @param myCoord The coordinates of the symbol (a position or an index)
4444
* @param id A unique identifier of the symbol (unique per ContextBase)
4545
*/
4646
class Symbol private[Symbols] (private var myCoord: Coord, val id: Int, val nestingLevel: Int)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
591591
val base = nonExprBaseType(tp1, cls2)
592592
if (base.typeSymbol == cls2) return true
593593
}
594-
else if tp1.isLambdaSub && !tp1.isAnyKind then
594+
else if tp1.typeParams.nonEmpty && !tp1.isAnyKind then
595595
return recur(tp1, EtaExpansion(tp2))
596596
fourthTry
597597
}

0 commit comments

Comments
 (0)