Skip to content

Commit 327ae1c

Browse files
authored
Merge branch 'master' into change-rewrite
2 parents 13a73bc + 3bf8a16 commit 327ae1c

File tree

98 files changed

+2467
-2151
lines changed

Some content is hidden

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

98 files changed

+2467
-2151
lines changed

compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma
626626

627627
def symbol: Symbol = a.tree.symbol
628628

629-
def args: List[Tree] = List.empty // those arguments to scala-defined annotations. they are never emmited
629+
def args: List[Tree] = List.empty // those arguments to scala-defined annotations. they are never emmitted
630630
}
631631

632632
def assocsFromApply(tree: Tree): List[(Name, Tree)] = {
@@ -810,7 +810,7 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma
810810
def annotations: List[Annotation] = toDenot(sym).annotations
811811
def companionModuleMembers: List[Symbol] = {
812812
// phase travel to exitingPickler: this makes sure that memberClassesOf only sees member classes,
813-
// not local classes of the companion module (E in the exmaple) that were lifted by lambdalift.
813+
// not local classes of the companion module (E in the example) that were lifted by lambdalift.
814814
if (linkedClass.isTopLevelModuleClass) /*exitingPickler*/ linkedClass.memberClasses
815815
else Nil
816816
}

compiler/src/dotty/tools/dotc/Driver.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class Driver extends DotClass {
118118
*
119119
* In most cases, you do not need a custom `Context` and should
120120
* instead use one of the other overloads of `process`. However,
121-
* the other overloads cannot be overriden, instead you
121+
* the other overloads cannot be overridden, instead you
122122
* should override this one which they call internally.
123123
*
124124
* Usage example: [[https://github.com/lampepfl/dotty/tree/master/test/test/OtherEntryPointsTest.scala]]

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ abstract class Positioned extends DotClass with Product {
168168
def check(p: Any): Unit = p match {
169169
case p: Positioned =>
170170
assert(pos contains p.pos,
171-
s"""position error, parent position does not contain child positon
171+
s"""position error, parent position does not contain child position
172172
|parent = $this,
173173
|parent position = $pos,
174174
|child = $p,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
10171017
lastParam.tpe match {
10181018
case defn.ArrayOf(el2) if el2 <:< el =>
10191019
// we have a JavaSeqLiteral with a more precise type
1020-
// we cannot construct a tree as JavaSeqLiteral infered to precise type
1020+
// we cannot construct a tree as JavaSeqLiteral inferred to precise type
10211021
// if we add typed than it would be both type-correct and
10221022
// will pass Ycheck
10231023
prefix ::: List(tpd.Typed(lastParam, TypeTree(defn.ArrayOf(el))))

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ object Config {
120120

121121
/** If this flag is set, it is checked that class type parameters are
122122
* only references with NoPrefix or ThisTypes as prefixes. This option
123-
* is usally disabled, because there are still some legitimate cases where
123+
* is usually disabled, because there are still some legitimate cases where
124124
* this can arise (e.g. for pos/Map.scala, in LambdaType.integrate).
125125
*/
126126
final val checkTypeParamRefs = false

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1233,7 +1233,7 @@ class Definitions {
12331233
// Temporary measure, as long as we do not read these classes from Tasty.
12341234
// Scala-2 classes don't have NoInits set even if they are pure. We override this
12351235
// for Product and Serializable so that case classes can be pure. A full solution
1236-
// requiers that we read all Scala code from Tasty.
1236+
// requires that we read all Scala code from Tasty.
12371237
ProductClass.setFlag(NoInits)
12381238
SerializableClass.setFlag(NoInits)
12391239

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,7 @@ object SymDenotations {
10681068
if (!canMatchInheritedSymbols && (owner ne inClass)) NoSymbol
10691069
else matchingDecl(inClass, owner.thisType)
10701070

1071-
/** All symbols overriden by this denotation. */
1071+
/** All symbols overridden by this denotation. */
10721072
final def allOverriddenSymbols(implicit ctx: Context): Iterator[Symbol] =
10731073
if (!canMatchInheritedSymbols) Iterator.empty
10741074
else overriddenFromType(owner.info)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ class TypeErasure(isJava: Boolean, semiEraseVCs: Boolean, isConstructor: Boolean
350350
* - For a refined type scala.Array+[T]:
351351
* - if T is Nothing or Null, []Object
352352
* - otherwise, if T <: Object, []|T|
353-
* - otherwise, if T is a type paramter coming from Java, []Object
353+
* - otherwise, if T is a type parameter coming from Java, []Object
354354
* - otherwise, Object
355355
* - For a term ref p.x, the type <noprefix> # x.
356356
* - For a typeref scala.Any, scala.AnyVal or scala.Singleton: |java.lang.Object|

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

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2309,9 +2309,9 @@ object Types {
23092309
}
23102310

23112311
/** A refined type parent { refinement }
2312-
* @param refinedName The name of the refinement declaration
2313-
* @param infoFn: A function that produces the info of the refinement declaration,
2314-
* given the refined type itself.
2312+
* @param parent The type being refined
2313+
* @param refinedName The name of the refinement declaration
2314+
* @param refinedInfo The info of the refinement declaration
23152315
*/
23162316
abstract case class RefinedType(parent: Type, refinedName: Name, refinedInfo: Type) extends RefinedOrRecType {
23172317

@@ -2370,6 +2370,31 @@ object Types {
23702370
}
23712371
}
23722372

2373+
/** A recursive type. Instances should be constructed via the companion object.
2374+
*
2375+
* @param parentExp A function that, given a recursive type R, produces a type
2376+
* that can refer to R via a `RecThis(R)` node. This is used to
2377+
* "tie the knot".
2378+
*
2379+
* For example, in
2380+
* class C { type T1; type T2 }
2381+
* type C2 = C { type T1; type T2 = T1 }
2382+
*
2383+
* The type of `C2` is a recursive type `{(x) => C{T1; T2 = x.T1}}`, written as
2384+
*
2385+
* RecType(
2386+
* RefinedType(
2387+
* RefinedType(
2388+
* TypeRef(...,class C),
2389+
* T1,
2390+
* TypeBounds(...)),
2391+
* T2,
2392+
* TypeBounds(
2393+
* TypeRef(RecThis(...),T1),
2394+
* TypeRef(RecThis(...),T1))))
2395+
*
2396+
* Where `RecThis(...)` points back to the enclosing `RecType`.
2397+
*/
23732398
class RecType(parentExp: RecType => Type) extends RefinedOrRecType with BindingType {
23742399

23752400
// See discussion in findMember#goRec why these vars are needed
@@ -2438,7 +2463,7 @@ object Types {
24382463
* 1. Nested Rec types on the type's spine are merged with the outer one.
24392464
* 2. Any refinement of the form `type T = z.T` on the spine of the type
24402465
* where `z` refers to the created rec-type is replaced by
2441-
* `type T`. This avoids infinite recursons later when we
2466+
* `type T`. This avoids infinite recursions later when we
24422467
* try to follow these references.
24432468
* TODO: Figure out how to guarantee absence of cycles
24442469
* of length > 1
@@ -2459,6 +2484,8 @@ object Types {
24592484
}
24602485
unique(rt.derivedRecType(normalize(rt.parent))).checkInst
24612486
}
2487+
2488+
/** Create a `RecType`, but only if the type generated by `parentExp` is indeed recursive. */
24622489
def closeOver(parentExp: RecType => Type)(implicit ctx: Context) = {
24632490
val rt = this(parentExp)
24642491
if (rt.isReferredToBy(rt.parent)) rt else rt.parent

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ object TastyFormat {
274274

275275
final val OBJECTCLASS = 23 // The name of an object class (or: module class) `<name>$`.
276276

277-
final val SIGNED = 63 // A pair of a name and a signature, used to idenitfy
277+
final val SIGNED = 63 // A pair of a name and a signature, used to idenitify
278278
// possibly overloaded methods.
279279
}
280280
object NameTags extends NameTags

0 commit comments

Comments
 (0)