Skip to content

Assertion error on invalid constructor calls with Ycheck:all. #6060

Closed
@sir-wabbit

Description

@sir-wabbit
class I1(i2: Int) {
def apply(i3: Int) = 1
new I1(1)(2) {}
}
class I0(i1: Int) {
class I0[I2] {
def apply(i3: Int) = 1
new I0[Int]()(2) {}
}
}

E-81862b78b5b2be6e163168c3d9b0456642eba622


checking test.scala after phase frontend
checking test.scala after phase staging
checking test.scala after phase posttyper
checking test.scala after phase pickler
checking test.scala after phase reifyQuotes
checking test.scala after phase MegaPhase{firstTransform, checkReentrant, elimPackagePrefixes, cookComments}
checking test.scala after phase MegaPhase{checkStatic, elimRepeated, expandSAMs, protectedAccessors, extmethods, shortcutImplicits, byNameClosures, hoistSuperArgs, classOf, refchecks}
checking test.scala after phase MegaPhase{elimOpaque, tryCatchPatterns, patternMatcher, explicitOuter, explicitSelf, stringInterpolatorOpt, crossCast}
checking test.scala after phase MegaPhase{pruneErasedDefs, vcInlineMethods, seqLiterals, intercepted, getters, elimByName, collectNullableFields, elimOuterSelect, augmentScala2Traits, resolveSuper, functionXXLForwarders, arrayConstructors}
checking test.scala after phase erasure
checking test.scala after phase MegaPhase{elimErasedValueType, vcElideAllocations, tailrec, mixin, lazyVals, memoize, nonLocalReturns, capturedVars}
exception while typing super() of class class dotty.tools.dotc.ast.Trees$Apply # 1308
exception while typing final class $anon() extends Int {
  super()
} of class class dotty.tools.dotc.ast.Trees$TypeDef # 1310
exception while typing {
  final class $anon() extends Int {
    super()
  }
  new I1{...}():I1
} of class class dotty.tools.dotc.ast.Trees$Block # 1500
exception while typing @scala.annotation.internal.SourceFile("test.scala") class I1(i2: Int) extends
  Object
 {
  super()
  private val i2: Int
  def apply(i3: Int): Int = 1
  {
    final class $anon() extends Int {
      super()
    }
    new I1{...}():I1
  }
} of class class dotty.tools.dotc.ast.Trees$TypeDef # 1509
exception while typing package <empty> {
  @scala.annotation.internal.SourceFile("test.scala") class I1(i2: Int) extends
    Object
   {
    super()
    private val i2: Int
    def apply(i3: Int): Int = 1
    {
      final class $anon() extends Int {
        super()
      }
      new I1{...}():I1
    }
  }
} of class class dotty.tools.dotc.ast.Trees$PackageDef # 1510
*** error while checking test.scala after phase capturedVars ***
exception occurred while compiling test.scala
class dotty.tools.dotc.reporting.diagnostic.messages$Error at test.scala:<43..43>: missing argument for parameter i2 of constructor I1: (i2: Int): I1 while compiling test.scala
Exception in thread "main" class dotty.tools.dotc.reporting.diagnostic.messages$Error at test.scala:<43..43>: missing argument for parameter i2 of constructor I1: (i2: Int): I1
	at dotty.tools.dotc.reporting.Reporting.error(Reporter.scala:99)
	at dotty.tools.dotc.typer.Applications$TypedApply.fail(Applications.scala:676)
	at dotty.tools.dotc.typer.Applications$Application.missingArg$2(Applications.scala:530)
	at dotty.tools.dotc.typer.Applications$Application.tryDefault$1(Applications.scala:538)
	at dotty.tools.dotc.typer.Applications$Application.matchArgs(Applications.scala:565)
	at dotty.tools.dotc.typer.Applications$Application.init(Applications.scala:340)
	at dotty.tools.dotc.typer.Applications$TypedApply.<init>(Applications.scala:654)
	at dotty.tools.dotc.typer.Applications$ApplyToTyped.<init>(Applications.scala:760)
	at dotty.tools.dotc.typer.Applications.simpleApply$1(Applications.scala:812)
	at dotty.tools.dotc.typer.Applications.realApply$4$$anonfun$3(Applications.scala:843)
	at dotty.tools.dotc.typer.Typer.tryEither(Typer.scala:2192)
	at dotty.tools.dotc.typer.Applications.realApply$1(Applications.scala:854)
	at dotty.tools.dotc.typer.Applications.typedApply(Applications.scala:889)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2012)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2066)
	at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:110)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typedUnadapted(TreeChecker.scala:267)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2100)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2112)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typed(TreeChecker.scala:255)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2151)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2173)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typedStats(TreeChecker.scala:429)
	at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:1677)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions