Skip to content

Commit d1f7968

Browse files
authored
Merge pull request #2716 from dotty-staging/fix-#2570-2
Fix #2570: Part 3 - The great () insert
2 parents 94e45f4 + b7afd43 commit d1f7968

File tree

128 files changed

+737
-488
lines changed

Some content is hidden

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

128 files changed

+737
-488
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,4 @@ compiler/test/debug/Gen.jar
7070

7171
compiler/before-pickling.txt
7272
compiler/after-pickling.txt
73+
*.dotty-ide-version

collection-strawman

Submodule collection-strawman updated 60 files

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ object desugar {
6969
val originalOwner = sym.owner
7070
def apply(tp: Type) = tp match {
7171
case tp: NamedType if tp.symbol.exists && (tp.symbol.owner eq originalOwner) =>
72-
val defctx = ctx.outersIterator.dropWhile(_.scope eq ctx.scope).next
72+
val defctx = ctx.outersIterator.dropWhile(_.scope eq ctx.scope).next()
7373
var local = defctx.denotNamed(tp.name).suchThat(_ is ParamOrAccessor).symbol
7474
if (local.exists) (defctx.owner.thisType select local).dealias
7575
else {
@@ -538,12 +538,12 @@ object desugar {
538538
val cdef1 = addEnumFlags {
539539
val originalTparamsIt = originalTparams.toIterator
540540
val originalVparamsIt = originalVparamss.toIterator.flatten
541-
val tparamAccessors = derivedTparams.map(_.withMods(originalTparamsIt.next.mods))
541+
val tparamAccessors = derivedTparams.map(_.withMods(originalTparamsIt.next().mods))
542542
val caseAccessor = if (isCaseClass) CaseAccessor else EmptyFlags
543543
val vparamAccessors = derivedVparamss match {
544544
case first :: rest =>
545-
first.map(_.withMods(originalVparamsIt.next.mods | caseAccessor)) ++
546-
rest.flatten.map(_.withMods(originalVparamsIt.next.mods))
545+
first.map(_.withMods(originalVparamsIt.next().mods | caseAccessor)) ++
546+
rest.flatten.map(_.withMods(originalVparamsIt.next().mods))
547547
case _ =>
548548
Nil
549549
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ object NavigateAST {
7070
def pathTo(pos: Position, from: Positioned, skipZeroExtent: Boolean = false)(implicit ctx: Context): List[Positioned] = {
7171
def childPath(it: Iterator[Any], path: List[Positioned]): List[Positioned] = {
7272
while (it.hasNext) {
73-
val path1 = it.next match {
73+
val path1 = it.next() match {
7474
case p: Positioned => singlePath(p, path)
7575
case xs: List[_] => childPath(xs.iterator, path)
7676
case _ => path

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ trait TreeInfo[T >: Untyped <: Type] { self: Trees.Instance[T] =>
5353
def map[R](f: (Symbol, Tree) => R): List[R] = {
5454
val b = List.newBuilder[R]
5555
foreach(b += f(_, _))
56-
b.result
56+
b.result()
5757
}
5858
}
5959

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ object Trees {
129129
private def checkChildrenTyped(it: Iterator[Any])(implicit ctx: Context): Unit =
130130
if (!this.isInstanceOf[Import[_]])
131131
while (it.hasNext)
132-
it.next match {
132+
it.next() match {
133133
case x: Ident[_] => // untyped idents are used in a number of places in typed trees
134134
case x: Tree[_] =>
135135
assert(x.hasType || ctx.reporter.errorsReported,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,15 +348,15 @@ object Contexts {
348348
*/
349349
def thisCallArgContext: Context = {
350350
assert(owner.isClassConstructor)
351-
val constrCtx = outersIterator.dropWhile(_.outer.owner == owner).next
351+
val constrCtx = outersIterator.dropWhile(_.outer.owner == owner).next()
352352
superOrThisCallContext(owner, constrCtx.scope)
353353
.setTyperState(typerState)
354354
.setGadt(gadt)
355355
}
356356

357357
/** The super- or this-call context with given owner and locals. */
358358
private def superOrThisCallContext(owner: Symbol, locals: Scope): FreshContext = {
359-
var classCtx = outersIterator.dropWhile(!_.isClassDefContext).next
359+
var classCtx = outersIterator.dropWhile(!_.isClassDefContext).next()
360360
classCtx.outer.fresh.setOwner(owner)
361361
.setScope(locals)
362362
.setMode(classCtx.mode | Mode.InSuperCall)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ object Decorators {
3737
implicit class SymbolIteratorDecorator(val it: Iterator[Symbol]) extends AnyVal {
3838
final def findSymbol(p: Symbol => Boolean): Symbol = {
3939
while (it.hasNext) {
40-
val sym = it.next
40+
val sym = it.next()
4141
if (p(sym)) return sym
4242
}
4343
NoSymbol

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,8 @@ object Denotations {
408408

409409
/** Sym preference provided types also override */
410410
def prefer(sym1: Symbol, sym2: Symbol, info1: Type, info2: Type) =
411-
preferSym(sym1, sym2) && info1.overrides(info2)
411+
preferSym(sym1, sym2) &&
412+
info1.overrides(info2, sym1.matchNullaryLoosely || sym2.matchNullaryLoosely)
412413

413414
def handleDoubleDef =
414415
if (preferSym(sym1, sym2)) denot1
@@ -512,7 +513,7 @@ object Denotations {
512513
def lubSym(overrides: Iterator[Symbol], previous: Symbol): Symbol =
513514
if (!overrides.hasNext) previous
514515
else {
515-
val candidate = overrides.next
516+
val candidate = overrides.next()
516517
if (owner2 derivesFrom candidate.owner)
517518
if (candidate isAccessibleFrom pre) candidate
518519
else lubSym(overrides, previous orElse candidate)
@@ -779,7 +780,7 @@ object Denotations {
779780
}
780781

781782
if (valid.runId != currentPeriod.runId)
782-
if (exists) initial.bringForward.current
783+
if (exists) initial.bringForward().current
783784
else this
784785
else {
785786
var cur = this

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ trait Phases {
2828
if ((this eq NoContext) || !phase.exists) Nil
2929
else {
3030
val rest = outersIterator.dropWhile(_.phase == phase)
31-
phase :: (if (rest.hasNext) rest.next.phasesStack else Nil)
31+
phase :: (if (rest.hasNext) rest.next().phasesStack else Nil)
3232
}
3333

3434
/** Execute `op` at given phase */

0 commit comments

Comments
 (0)