Skip to content

Commit fb4adc3

Browse files
authored
Merge branch 'master' into fix-2253
2 parents cf37737 + de6461a commit fb4adc3

21 files changed

+167
-63
lines changed

.drone.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pipeline:
4040

4141
matrix:
4242
TEST:
43+
- dotty-bin-tests/test
44+
- legacyTests
4345
- test
4446
- ;publishLocal ;dotty-bootstrapped/test
45-
- legacyTests
46-
- dotty-bin-tests/test

.drone.yml.sig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
eyJhbGciOiJIUzI1NiJ9.IyBBZnRlciB1cGRhdGluZyB0aGlzIGZpbGUsIHlvdSBuZWVkIHRvIHJlLXNpZ24gaXQ6CiMKIyAtIEluc3RhbGwgW2Ryb25lLWNsaV0oaHR0cDovL3JlYWRtZS5kcm9uZS5pby91c2FnZS9nZXR0aW5nLXN0YXJ0ZWQtY2xpLykKIyAtIENvcHkgeW91ciB0b2tlbiBmcm9tICBodHRwOi8vZG90dHktY2kuZXBmbC5jaC9hY2NvdW50IChDbGljayBTSE9XIFRPS0VOKQojIC0gKGV4cG9ydCBEUk9ORV9UT0tFTj15b3VyLXRva2VuOyBleHBvcnQgRFJPTkVfU0VSVkVSPWh0dHA6Ly9kb3R0eS1jaS5lcGZsLmNoOyBkcm9uZSBzaWduIGxhbXBlcGZsL2RvdHR5KQoKcGlwZWxpbmU6CiAgdGVzdDoKICAgIGltYWdlOiBsYW1wZXBmbC9kb3R0eTpsYXRlc3QKICAgIHB1bGw6IHRydWUKICAgIGNvbW1hbmRzOgogICAgICAtIGxuIC1zIC92YXIvY2FjaGUvZHJvbmUvc2NhbGEtc2NhbGEgc2NhbGEtc2NhbGEKICAgICAgLSBsbiAtcyAvdmFyL2NhY2hlL2Ryb25lL2l2eTIgIiRIT01FLy5pdnkyIgogICAgICAtIC4vc2NyaXB0cy91cGRhdGUtc2NhbGEtbGlicmFyeQogICAgICAtIH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XN0ZXIKICAgICAgc3RhdHVzOiBjaGFuZ2VkCgogIHNsYWNrOgogICAgaW1hZ2U6IHBsdWdpbnMvc2xhY2sKICAgIGNoYW5uZWw6IGRvdHR5CiAgICB3aGVuOgogICAgICBicmFuY2g6IG1hc3RlcgogICAgICBzdGF0dXM6IGNoYW5nZWQKCm1hdHJpeDoKICBURVNUOgogICAgLSBkb3R0eS1iaW4tdGVzdHMvdGVzdAogICAgLSBsZWdhY3lUZXN0cwogICAgLSB0ZXN0CiAgICAtIDtwdWJsaXNoTG9jYWwgO2RvdHR5LWJvb3RzdHJhcHBlZC90ZXN0Cg.bGW0VXWjWrro4w7rn_6Aq2veQaxXr7x3KJJCaF3X8V8

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import scala.collection.{ mutable, immutable }
1010
import PartialFunction._
1111
import collection.mutable
1212
import util.common.alwaysZero
13-
import typer.Applications
1413

1514
object Definitions {
1615

@@ -846,6 +845,9 @@ class Definitions {
846845
TupleType(elems.size).appliedTo(elems)
847846
}
848847

848+
def isProductSubType(tp: Type)(implicit ctx: Context) =
849+
tp.derivesFrom(ProductType.symbol)
850+
849851
/** Is `tp` (an alias) of either a scala.FunctionN or a scala.ImplicitFunctionN? */
850852
def isFunctionType(tp: Type)(implicit ctx: Context) = {
851853
val arity = functionArity(tp)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ object NameKinds {
209209
val InlineAccessorName = new UniqueNameKind("$_inlineAccessor_$")
210210
val TempResultName = new UniqueNameKind("ev$")
211211
val EvidenceParamName = new UniqueNameKind("evidence$")
212-
val DepParamName = new UniqueNameKind("<param>")
212+
val DepParamName = new UniqueNameKind("(param)")
213213
val LazyImplicitName = new UniqueNameKind("$_lazy_implicit_$")
214214
val LazyLocalName = new UniqueNameKind("$lzy")
215215
val LazyLocalInitName = new UniqueNameKind("$lzyINIT")

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import SymDenotations._, Denotations.SingleDenotation
77
import config.Printers.typr
88
import util.Positions._
99
import NameOps._
10+
import NameKinds.DepParamName
1011
import Decorators._
1112
import StdNames._
1213
import Annotations._
@@ -158,7 +159,11 @@ trait TypeOps { this: Context => // TODO: Make standalone object.
158159
case tp1 => tp1
159160
}
160161
case tp: TypeParamRef =>
161-
typerState.constraint.typeVarOfParam(tp) orElse tp
162+
if (tp.paramName.is(DepParamName)) {
163+
val bounds = ctx.typeComparer.bounds(tp)
164+
if (bounds.lo.isRef(defn.NothingClass)) bounds.hi else bounds.lo
165+
}
166+
else typerState.constraint.typeVarOfParam(tp) orElse tp
162167
case _: ThisType | _: BoundType | NoPrefix =>
163168
tp
164169
case tp: RefinedType =>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3509,7 +3509,7 @@ object Types {
35093509

35103510
def apply(tp: Type): Type
35113511

3512-
protected var variance = 1
3512+
protected[core] var variance = 1
35133513

35143514
protected def derivedSelect(tp: NamedType, pre: Type): Type =
35153515
tp.derivedSelect(pre)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1408,7 +1408,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {
14081408
protected def seqTree(binder: Symbol) = tupleSel(binder)(firstIndexingBinder + 1)
14091409
protected def tupleSel(binder: Symbol)(i: Int): Tree = {
14101410
val accessors =
1411-
if (Applications.canProductMatch(binder.info))
1411+
if (defn.isProductSubType(binder.info))
14121412
productSelectors(binder.info)
14131413
else binder.caseAccessors
14141414
val res =

compiler/src/dotty/tools/dotc/typer/Applications.scala

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ object Applications {
4848
ref.info.widenExpr.dealias
4949
}
5050

51-
def canProductMatch(tp: Type)(implicit ctx: Context) =
52-
extractorMemberType(tp, nme._1).exists
53-
5451
/** Does `tp` fit the "product match" conditions as an unapply result type
5552
* for a pattern with `numArgs` subpatterns?
5653
* This is the case of `tp` has members `_1` to `_N` where `N == numArgs`.
@@ -72,7 +69,7 @@ object Applications {
7269
}
7370

7471
def productArity(tp: Type)(implicit ctx: Context) =
75-
if (canProductMatch(tp)) productSelectorTypes(tp).size else -1
72+
if (defn.isProductSubType(tp)) productSelectorTypes(tp).size else -1
7673

7774
def productSelectors(tp: Type)(implicit ctx: Context): List[Symbol] = {
7875
val sels = for (n <- Iterator.from(0)) yield tp.member(nme.selectorName(n)).symbol
@@ -114,7 +111,7 @@ object Applications {
114111
getUnapplySelectors(getTp, args, pos)
115112
else if (unapplyResult isRef defn.BooleanClass)
116113
Nil
117-
else if (canProductMatch(unapplyResult))
114+
else if (defn.isProductSubType(unapplyResult))
118115
productSelectorTypes(unapplyResult)
119116
// this will cause a "wrong number of arguments in pattern" error later on,
120117
// which is better than the message in `fail`.

compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,10 @@ object ProtoTypes {
377377
* Also, if `owningTree` is non-empty, add a type variable for each parameter.
378378
* @return The added type lambda, and the list of created type variables.
379379
*/
380-
def constrained(tl: TypeLambda, owningTree: untpd.Tree)(implicit ctx: Context): (TypeLambda, List[TypeTree]) = {
380+
def constrained(tl: TypeLambda, owningTree: untpd.Tree, alwaysAddTypeVars: Boolean = false)(implicit ctx: Context): (TypeLambda, List[TypeTree]) = {
381381
val state = ctx.typerState
382-
assert(!(ctx.typerState.isCommittable && owningTree.isEmpty),
382+
val addTypeVars = alwaysAddTypeVars || !owningTree.isEmpty
383+
assert(!(ctx.typerState.isCommittable && !addTypeVars),
383384
s"inconsistent: no typevars were added to committable constraint ${state.constraint}")
384385

385386
def newTypeVars(tl: TypeLambda): List[TypeTree] =
@@ -392,21 +393,21 @@ object ProtoTypes {
392393
val added =
393394
if (state.constraint contains tl) tl.newLikeThis(tl.paramNames, tl.paramInfos, tl.resultType)
394395
else tl
395-
val tvars = if (owningTree.isEmpty) Nil else newTypeVars(added)
396+
val tvars = if (addTypeVars) newTypeVars(added) else Nil
396397
ctx.typeComparer.addToConstraint(added, tvars.tpes.asInstanceOf[List[TypeVar]])
397398
(added, tvars)
398399
}
399400

400401
/** Same as `constrained(tl, EmptyTree)`, but returns just the created type lambda */
401402
def constrained(tl: TypeLambda)(implicit ctx: Context): TypeLambda = constrained(tl, EmptyTree)._1
402403

403-
/** Create a new TypeParamRef that represents a dependent method parameter singleton */
404-
def newDepTypeParamRef(tp: Type)(implicit ctx: Context): TypeParamRef = {
404+
/** Create a new TypeVar that represents a dependent method parameter singleton */
405+
def newDepTypeVar(tp: Type)(implicit ctx: Context): TypeVar = {
405406
val poly = PolyType(DepParamName.fresh().toTypeName :: Nil)(
406407
pt => TypeBounds.upper(AndType(tp, defn.SingletonType)) :: Nil,
407408
pt => defn.AnyType)
408-
ctx.typeComparer.addToConstraint(poly, Nil)
409-
TypeParamRef(poly, 0)
409+
constrained(poly, untpd.EmptyTree, alwaysAddTypeVars = true)
410+
._2.head.tpe.asInstanceOf[TypeVar]
410411
}
411412

412413
/** The result type of `mt`, where all references to parameters of `mt` are
@@ -415,7 +416,7 @@ object ProtoTypes {
415416
def resultTypeApprox(mt: MethodType)(implicit ctx: Context): Type =
416417
if (mt.isDependent) {
417418
def replacement(tp: Type) =
418-
if (ctx.mode.is(Mode.TypevarsMissContext)) WildcardType else newDepTypeParamRef(tp)
419+
if (ctx.mode.is(Mode.TypevarsMissContext)) WildcardType else newDepTypeVar(tp)
419420
mt.resultType.substParams(mt, mt.paramInfos.map(replacement))
420421
}
421422
else mt.resultType

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
759759
/** Is `formal` a product type which is elementwise compatible with `params`? */
760760
def ptIsCorrectProduct(formal: Type) = {
761761
isFullyDefined(formal, ForceDegree.noBottom) &&
762-
Applications.canProductMatch(formal) &&
762+
defn.isProductSubType(formal) &&
763763
Applications.productSelectorTypes(formal).corresponds(params) {
764764
(argType, param) =>
765765
param.tpt.isEmpty || argType <:< typedAheadType(param.tpt).tpe

compiler/test/dotty/tools/dotc/CompilationTests.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ class CompilationTests extends ParallelTesting {
156156
compileFile("../tests/neg/customArgs/nopredef.scala", defaultOptions.and("-Yno-predef")) +
157157
compileFile("../tests/neg/customArgs/noimports.scala", defaultOptions.and("-Yno-imports")) +
158158
compileFile("../tests/neg/customArgs/noimports2.scala", defaultOptions.and("-Yno-imports")) +
159+
compileFile("../tests/neg/customArgs/overloadsOnAbstractTypes.scala", allowDoubleBindings) +
159160
compileFile("../tests/neg/tailcall/t1672b.scala", defaultOptions) +
160161
compileFile("../tests/neg/tailcall/t3275.scala", defaultOptions) +
161162
compileFile("../tests/neg/tailcall/t6574.scala", defaultOptions) +
@@ -216,9 +217,9 @@ class CompilationTests extends ParallelTesting {
216217
val opt = Array(
217218
"-classpath",
218219
// compile with bootstrapped library on cp:
219-
defaultOutputDir + "lib$1/src/:" +
220+
defaultOutputDir + "lib/src/:" +
220221
// as well as bootstrapped compiler:
221-
defaultOutputDir + "dotty1$1/dotty/:" +
222+
defaultOutputDir + "dotty1/dotty/:" +
222223
Jars.dottyInterfaces
223224
)
224225

compiler/test/dotty/tools/dotc/reporting/TestReporter.scala

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,23 +91,41 @@ extends Reporter with UniqueMessagePositions with HideNonSensicalMessages with M
9191
}
9292

9393
object TestReporter {
94-
lazy val logWriter = {
94+
private[this] var outFile: JFile = _
95+
private[this] var logWriter: PrintWriter = _
96+
97+
private[this] def initLog() = if (logWriter eq null) {
9598
val df = new SimpleDateFormat("yyyy-MM-dd-HH:mm")
9699
val timestamp = df.format(new Date)
97100
new JFile("../testlogs").mkdirs()
98-
new PrintWriter(new FileOutputStream(new JFile(s"../testlogs/tests-$timestamp.log"), true))
101+
outFile = new JFile(s"../testlogs/tests-$timestamp.log")
102+
logWriter = new PrintWriter(new FileOutputStream(outFile, true))
99103
}
100104

101-
def writeToLog(str: String) = {
105+
def logPrintln(str: String) = {
106+
initLog()
102107
logWriter.println(str)
103108
logWriter.flush()
104109
}
105110

111+
def logPrint(str: String): Unit = {
112+
initLog()
113+
logWriter.println(str)
114+
}
115+
116+
def logFlush(): Unit =
117+
if (logWriter ne null) logWriter.flush()
118+
119+
def logPath: String = {
120+
initLog()
121+
outFile.getCanonicalPath
122+
}
123+
106124
def reporter(ps: PrintStream, logLevel: Int): TestReporter =
107-
new TestReporter(new PrintWriter(ps, true), writeToLog, logLevel)
125+
new TestReporter(new PrintWriter(ps, true), logPrintln, logLevel)
108126

109127
def simplifiedReporter(writer: PrintWriter): TestReporter = {
110-
val rep = new TestReporter(writer, writeToLog, WARNING) {
128+
val rep = new TestReporter(writer, logPrintln, WARNING) {
111129
/** Prints the message with the given position indication in a simplified manner */
112130
override def printMessageAndPos(m: MessageContainer, extra: String)(implicit ctx: Context): Unit = {
113131
def report() = {

compiler/test/dotty/tools/vulpix/ParallelTesting.scala

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,6 @@ trait ParallelTesting extends RunnerOrchestration { self =>
192192

193193
/** A runnable that logs its contents in a buffer */
194194
trait LoggedRunnable extends Runnable {
195-
import TestReporter.logWriter
196-
197195
/** Instances of `LoggedRunnable` implement this method instead of the
198196
* `run` method
199197
*/
@@ -212,8 +210,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
212210

213211
final def run(): Unit = {
214212
checkTestSource()
215-
logBuffer.iterator.foreach(logWriter.println)
216-
logWriter.flush()
213+
summaryReport.echoToLog(logBuffer.iterator)
217214
}
218215
}
219216

@@ -265,7 +262,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
265262
private[this] val failedTestSources = mutable.ArrayBuffer.empty[String]
266263
protected final def failTestSource(testSource: TestSource, reason: Option[String] = None) = synchronized {
267264
val extra = reason.map(" with reason: " + _).getOrElse("")
268-
failedTestSources.append(testSource.title + s" failed (in ${testSource.name})" + extra)
265+
failedTestSources.append(testSource.title + s" failed" + extra)
269266
fail()
270267
}
271268

@@ -309,7 +306,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
309306
protected def tryCompile(testSource: TestSource)(op: => Unit): Unit =
310307
try {
311308
val testing = s"Testing ${testSource.title}"
312-
TestReporter.logWriter.println(testing)
309+
summaryReport.echoToLog(testing)
313310
if (!isInteractive) realStdout.println(testing)
314311
op
315312
} catch {
@@ -519,6 +516,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
519516
}
520517

521518
case Failure(output) =>
519+
echo(s"Test '${testSource.title}' failed with output:")
522520
echo(output)
523521
failTestSource(testSource)
524522

@@ -574,7 +572,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
574572

575573
if (!compilerCrashed && errorCount == 0) verifier()
576574
else {
577-
echo(s"\n Compilation failed for: '$testSource'")
575+
echo(s" Compilation failed for: '${testSource.title}' ")
578576
val buildInstr = testSource.buildInstructions(errorCount, warningCount)
579577
addFailureInstruction(buildInstr)
580578
failTestSource(testSource)
@@ -1018,6 +1016,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
10181016
.getOrElse {
10191017
throw new IllegalStateException("Unable to reflectively find calling method")
10201018
}
1019+
.takeWhile(_ != '$')
10211020
}
10221021

10231022
/** Compiles a single file from the string path `f` using the supplied flags */
@@ -1072,7 +1071,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
10721071
val targetDir = new JFile(outDir + "/" + sourceDir.getName + "/")
10731072
targetDir.mkdirs()
10741073

1075-
val target = JointCompilationSource(callingMethod, randomized, flags, targetDir)
1074+
val target = JointCompilationSource(s"compiling '$f' in test '$callingMethod'", randomized, flags, targetDir)
10761075
new CompilationTest(target)
10771076
}
10781077

@@ -1089,7 +1088,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
10891088
targetDir.mkdirs()
10901089
assert(targetDir.exists, s"couldn't create target directory: $targetDir")
10911090

1092-
val target = JointCompilationSource(callingMethod, files.map(new JFile(_)).toArray, flags, targetDir)
1091+
val target = JointCompilationSource(s"$testName from $callingMethod", files.map(new JFile(_)).toArray, flags, targetDir)
10931092

10941093
// Create a CompilationTest and let the user decide whether to execute a pos or a neg test
10951094
new CompilationTest(target)

compiler/test/dotty/tools/vulpix/RunnerOrchestration.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package tools
33
package vulpix
44

55
import java.io.{ File => JFile, InputStreamReader, BufferedReader, PrintStream }
6+
import java.util.concurrent.atomic.AtomicBoolean
67
import java.util.concurrent.TimeoutException
78

89
import scala.concurrent.duration.Duration
@@ -84,11 +85,11 @@ trait RunnerOrchestration {
8485
}
8586

8687
/** Did add hook to kill the child VMs? */
87-
private[this] var didAddCleanupCallback = false
88+
private[this] val didAddCleanupCallback = new AtomicBoolean(false)
8889

8990
/** Blocks less than `maxDuration` while running `Test.main` from `dir` */
9091
def runMain(classPath: String)(implicit summaryReport: SummaryReporting): Status = {
91-
if (!didAddCleanupCallback) {
92+
if (didAddCleanupCallback.compareAndSet(false, true)) {
9293
// If for some reason the test runner (i.e. sbt) doesn't kill the VM, we
9394
// need to clean up ourselves.
9495
summaryReport.addCleanup(killAll)

0 commit comments

Comments
 (0)