Skip to content

Commit 6c08fce

Browse files
committed
Copy last version of dotc to test files
1 parent e09175e commit 6c08fce

File tree

113 files changed

+1994
-1285
lines changed

Some content is hidden

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

113 files changed

+1994
-1285
lines changed

tests/pos-with-compiler-cc/dotc/Run.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import java.nio.charset.StandardCharsets
3131
import scala.collection.mutable
3232
import scala.util.control.NonFatal
3333
import scala.io.Codec
34-
import caps.unsafe.unsafeUnbox
3534

3635
/** A compiler run. Exports various methods to compile source files */
3736
class Run(comp: Compiler, ictx: Context) extends ImplicitRunInfo with ConstraintRunInfo {
@@ -271,7 +270,7 @@ class Run(comp: Compiler, ictx: Context) extends ImplicitRunInfo with Constraint
271270
Rewrites.writeBack()
272271
suppressions.runFinished(hasErrors = ctx.reporter.hasErrors)
273272
while (finalizeActions.nonEmpty) {
274-
val action = finalizeActions.remove(0).unsafeUnbox
273+
val action = finalizeActions.remove(0)
275274
action()
276275
}
277276
compiling = false

tests/pos-with-compiler-cc/dotc/ast/Desugar.scala

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ object desugar {
673673
else (Nil, Nil)
674674
}
675675

676-
var parents1: List[untpd.Tree] = parents // !cc! need explicit type to make capture checking pass
676+
var parents1 = parents
677677
if (isEnumCase && parents.isEmpty)
678678
parents1 = enumClassTypeRef :: Nil
679679
if (isNonEnumCase)
@@ -1779,10 +1779,7 @@ object desugar {
17791779
val elems = segments flatMap {
17801780
case ts: Thicket => ts.trees.tail
17811781
case t => Nil
1782-
} map { (t: Tree) => t match
1783-
// !cc! explicitly typed parameter (t: Tree) is needed since otherwise
1784-
// we get an error similar to #16268. (The explicit type constrains the type of `segments`
1785-
// which is otherwise List[{*} tree])
1782+
} map {
17861783
case Block(Nil, EmptyTree) => Literal(Constant(())) // for s"... ${} ..."
17871784
case Block(Nil, expr) => expr // important for interpolated string as patterns, see i1773.scala
17881785
case t => t

tests/pos-with-compiler-cc/dotc/ast/Positioned.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import annotation.internal.sharable
1515

1616
/** A base class for things that have positions (currently: modifiers and trees)
1717
*/
18-
abstract class Positioned(implicit @constructorOnly src: SourceFile) extends SrcPos, Product, Cloneable, caps.Pure {
18+
abstract class Positioned(implicit @constructorOnly src: SourceFile) extends SrcPos, Product, Cloneable {
1919
import Positioned.{ids, nextId, debugId}
2020

2121
private var mySpan: Span = _

tests/pos-with-compiler-cc/dotc/ast/TreeInfo.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ import scala.collection.mutable
1414

1515
import scala.annotation.tailrec
1616

17-
trait TreeInfo[T >: Untyped <: Type] { self: Trees.Instance[T] =>
18-
19-
// Note: the <: Type constraint looks necessary (and is needed to make the file compile in dotc).
20-
// But Scalac accepts the program happily without it. Need to find out why.
17+
trait TreeInfo[T <: Untyped] { self: Trees.Instance[T] =>
2118

2219
def unsplice(tree: Trees.Tree[T]): Trees.Tree[T] = tree
2320

tests/pos-with-compiler-cc/dotc/ast/TreeTypeMap.scala

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import Types._, Contexts._, Flags._
77
import Symbols._, Annotations._, Trees._, Symbols._, Constants.Constant
88
import Decorators._
99
import dotty.tools.dotc.transform.SymUtils._
10-
import language.experimental.pureFunctions
1110

1211
/** A map that applies three functions and a substitution together to a tree and
1312
* makes sure they are coordinated so that the result is well-typed. The functions are
@@ -33,8 +32,8 @@ import language.experimental.pureFunctions
3332
* set, we would get a data race assertion error.
3433
*/
3534
class TreeTypeMap(
36-
val typeMap: Type -> Type = IdentityTypeMap,
37-
val treeMap: tpd.Tree -> tpd.Tree = identity[tpd.Tree](_), // !cc! need explicit instantiation of default argument
35+
val typeMap: Type => Type = IdentityTypeMap,
36+
val treeMap: tpd.Tree => tpd.Tree = identity _,
3837
val oldOwners: List[Symbol] = Nil,
3938
val newOwners: List[Symbol] = Nil,
4039
val substFrom: List[Symbol] = Nil,
@@ -43,8 +42,8 @@ class TreeTypeMap(
4342
import tpd._
4443

4544
def copy(
46-
typeMap: Type -> Type,
47-
treeMap: tpd.Tree -> tpd.Tree,
45+
typeMap: Type => Type,
46+
treeMap: tpd.Tree => tpd.Tree,
4847
oldOwners: List[Symbol],
4948
newOwners: List[Symbol],
5049
substFrom: List[Symbol],

0 commit comments

Comments
 (0)