Skip to content

reporting.diagnostic.messages.Error #5045

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sir-wabbit opened this issue Aug 26, 2018 · 1 comment
Closed

reporting.diagnostic.messages.Error #5045

sir-wabbit opened this issue Aug 26, 2018 · 1 comment

Comments

@sir-wabbit
Copy link

class I1(i2: Int) {
  class I1[I3] {
    def apply(i4: Int) = 1
    new I1[Int]()(2) {}
  }
}

without -Ycheck:all it gives a weird error:

4 |    new I1[Int]()(2) {}
  |    ^
  |wrong number of arguments at getClass for ($outer: I1): I1.this.I1: (($outer: I1): I1.this.I1)(this.<init>), expected: 1, found: 0
one error found

with -Ycheck:all

checking E-6cfc2bdeca4ea50004eafb57de18c7e149e70182.scala after phase MegaPhase{elimErasedValueType, vcElideAllocations, mixin, lazyVals, memoize, nonLocalReturns, capturedVars}
exception while typing super() of class class dotty.tools.dotc.ast.Trees$Apply # 1048
exception while typing final class $anon($outer: I1.this.I1) extends Int { 
  super()
  private val $outer: I1.this.I1
  private <accessor> def $outer(): I1.this.I1 = this.$outer
  final def I1$I1$_$$anon$$$outer(): I1.this.I1 = $outer()
} of class class dotty.tools.dotc.ast.Trees$TypeDef # 1050
exception while typing {
  final class $anon($outer: I1.this.I1) extends Int { 
    super()
    private val $outer: I1.this.I1
    private <accessor> def $outer(): I1.this.I1 = this.$outer
    final def I1$I1$_$$anon$$$outer(): I1.this.I1 = $outer()
  }
  new I1.this.I1{...}(this): I1.this.I1
} of class class dotty.tools.dotc.ast.Trees$Block # 1240
exception while typing class I1($outer: I1) extends Object { 
  super()
  def apply(i4: Int): Int = 1
  {
    final class $anon($outer: I1.this.I1) extends Int { 
      super()
      private val $outer: I1.this.I1
      private <accessor> def $outer(): I1.this.I1 = this.$outer
      final def I1$I1$_$$anon$$$outer(): I1.this.I1 = $outer()
    }
    new I1.this.I1{...}(this): I1.this.I1
  }
  private val $outer: I1
  private <accessor> def $outer(): I1 = this.$outer
  final def I1$I1$$$outer(): I1 = I1.this.$outer()
} of class class dotty.tools.dotc.ast.Trees$TypeDef # 1256
exception while typing @scala.annotation.internal.SourceFile(
  "E-6cfc2bdeca4ea50004eafb57de18c7e149e70182.scala"
) class I1(i2: Int) extends Object { 
  super()
  private val i2: Int
  class I1($outer: I1) extends Object { 
    super()
    def apply(i4: Int): Int = 1
    {
      final class $anon($outer: I1.this.I1) extends Int { 
        super()
        private val $outer: I1.this.I1
        private <accessor> def $outer(): I1.this.I1 = this.$outer
        final def I1$I1$_$$anon$$$outer(): I1.this.I1 = $outer()
      }
      new I1.this.I1{...}(this): I1.this.I1
    }
    private val $outer: I1
    private <accessor> def $outer(): I1 = this.$outer
    final def I1$I1$$$outer(): I1 = I1.this.$outer()
  }
} of class class dotty.tools.dotc.ast.Trees$TypeDef # 1265
exception while typing package <empty> {
  @scala.annotation.internal.SourceFile(
    "E-6cfc2bdeca4ea50004eafb57de18c7e149e70182.scala"
  ) class I1(i2: Int) extends Object { 
    super()
    private val i2: Int
    class I1($outer: I1) extends Object { 
      super()
      def apply(i4: Int): Int = 1
      {
        final class $anon($outer: I1.this.I1) extends Int { 
          super()
          private val $outer: I1.this.I1
          private <accessor> def $outer(): I1.this.I1 = this.$outer
          final def I1$I1$_$$anon$$$outer(): I1.this.I1 = $outer()
        }
        new I1.this.I1{...}(this): I1.this.I1
      }
      private val $outer: I1
      private <accessor> def $outer(): I1 = this.$outer
      final def I1$I1$$$outer(): I1 = I1.this.$outer()
    }
  }
} of class class dotty.tools.dotc.ast.Trees$PackageDef # 1266
*** error while checking E-6cfc2bdeca4ea50004eafb57de18c7e149e70182.scala after phase capturedVars ***
exception occurred while compiling E-6cfc2bdeca4ea50004eafb57de18c7e149e70182.scala
Exception in thread "main" class dotty.tools.dotc.reporting.diagnostic.messages$Error at E-6cfc2bdeca4ea50004eafb57de18c7e149e70182.scala:4: not enough arguments for constructor I1: ($outer: I1): I1.this.I1
	at dotty.tools.dotc.reporting.Reporting.error(Reporter.scala:96)
	at dotty.tools.dotc.typer.Applications$TypedApply.fail(Applications.scala:587)
	at dotty.tools.dotc.typer.Applications$Application.missingArg$2(Applications.scala:445)
	at dotty.tools.dotc.typer.Applications$Application.tryDefault$1(Applications.scala:450)
	at dotty.tools.dotc.typer.Applications$Application.matchArgs(Applications.scala:476)
	at dotty.tools.dotc.typer.Applications$Application.init(Applications.scala:256)
	at dotty.tools.dotc.typer.Applications$TypedApply.<init>(Applications.scala:565)
	at dotty.tools.dotc.typer.Applications$ApplyToTyped.<init>(Applications.scala:671)
	at dotty.tools.dotc.typer.Applications.simpleApply$1(Applications.scala:721)
	at dotty.tools.dotc.typer.Applications.realApply$4$$anonfun$3(Applications.scala:748)
	at dotty.tools.dotc.typer.Typer.tryEither(Typer.scala:1984)
	at dotty.tools.dotc.typer.Applications.realApply$1(Applications.scala:759)
	at dotty.tools.dotc.typer.Applications.typedApply(Applications.scala:794)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1818)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1869)
	at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:112)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typedUnadapted(TreeChecker.scala:282)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1900)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1912)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typed(TreeChecker.scala:270)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:1952)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:1965)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typedStats(TreeChecker.scala:446)
	at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:1565)

E-6cfc2bdeca4ea50004eafb57de18c7e149e70182

@nicolasstucki
Copy link
Contributor

smarter added a commit to dotty-staging/dotty that referenced this issue Apr 30, 2019
@odersky odersky closed this as completed in 6491b48 May 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants