Skip to content

Commit 7b621c4

Browse files
liufengyunEnzeXingolhotak
authored
Fix typos
Co-authored-by: EnzeXing <[email protected]> Co-authored-by: Ondřej Lhoták <[email protected]>
1 parent dc825e4 commit 7b621c4

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ object Types {
376376
case _ => false
377377
}
378378

379-
/** Returns the annoation that is an instance of `cls` carried by the type. */
379+
/** Returns the annotation that is an instance of `cls` carried by the type. */
380380
@tailrec final def getAnnotation(cls: ClassSymbol)(using Context): Option[Annotation] = stripTypeVar match {
381381
case AnnotatedType(tp, annot) =>
382382
if annot.matches(cls) then Some(annot)

compiler/src/dotty/tools/dotc/transform/init/Objects.scala

+4-4
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ object Objects:
123123
def show(using Context) = "ObjectRef(" + klass.show + ")"
124124

125125
/**
126-
* Rerepsents values that are instances of the specified class.
126+
* Represents values that are instances of the specified class.
127127
*
128128
* Note that the 2nd parameter block does not take part in the definition of equality.
129129
*/
@@ -150,7 +150,7 @@ object Objects:
150150
instance
151151

152152
/**
153-
* Rerepsents arrays.
153+
* Represents arrays.
154154
*
155155
* Note that the 2nd parameter block does not take part in the definition of equality.
156156
*
@@ -289,7 +289,7 @@ object Objects:
289289
val level = outer.level + 1
290290

291291
if (level > 3)
292-
report.warning("[Internal error] Deeply nested environemnt, level = " + level + ", " + meth.show + " in " + meth.enclosingClass.show, meth.defTree)
292+
report.warning("[Internal error] Deeply nested environment, level = " + level + ", " + meth.show + " in " + meth.enclosingClass.show, meth.defTree)
293293

294294
private[Env] val vals: mutable.Map[Symbol, Value] = valsMap
295295
private[Env] val vars: mutable.Map[Symbol, Heap.Addr] = varsMap
@@ -418,7 +418,7 @@ object Objects:
418418
*/
419419
opaque type Data = Map[Addr, Value]
420420

421-
/** Store the heap as a mutable field to avoid thread through it in the program. */
421+
/** Store the heap as a mutable field to avoid threading it through the program. */
422422
class MutableData(private[Heap] var heap: Data):
423423
private[Heap] def update(addr: Addr, value: Value): Unit =
424424
heap.get(addr) match

library/src/scala/annotation/init.scala

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ object init:
2121
*
2222
* By default, method and constructor arguments are widened to height 1.
2323
*/
24-
final class widen(hight: Int) extends StaticAnnotation
24+
final class widen(height: Int) extends StaticAnnotation
2525

2626
/** Introduce a region context.
2727
*
2828
* The same mutable field in the same region have the same abstract representation.
2929
*
30-
* The concept of regions is intended to make context-sensitivity tuable for complex use cases.
30+
* The concept of regions is intended to make context-sensitivity tunable for complex use cases.
3131
*
3232
* Example:
3333
*
@@ -41,7 +41,7 @@ object init:
4141
* val box2: Box = region { new Box(new D(10)) }
4242
* val m: Int = box1.value.foo()
4343
*
44-
* In the above, without the two region annotation, the two objects `box1` and `box2` are in the same region.
44+
* In the above, without the two region annotations, the two objects `box1` and `box2` are in the same region.
4545
* Therefore, the field `box1.value` and `box2.value` points to both instances of `C` and `D`. Consequently,
4646
* the method call `box1.value.foo()` will be invalid, because it reaches `A.m`, which is not yet initialized.
4747
* The explicit context annotation solves the problem.

0 commit comments

Comments
 (0)