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

Compiler crashes on self invocation with too many argument lists on class that defines apply. #11391

Open
SrTobi opened this Issue Feb 4, 2019 · 0 comments

Comments

Projects
None yet
2 participants
@SrTobi
Copy link

SrTobi commented Feb 4, 2019

class A(i: Int) {
 def this() = this(3)(3)
 def apply(i: Int) = ???
}

crashes with (in ammonite):

Error while emitting cmd0.sc
assertion failed: 
  Cannot emit primitive conversion from V to Lammonite/$sess/cmd0$A; - cmd0.sc
     while compiling: cmd0.sc
        during phase: jvm
     library version: version 2.12.8
    compiler version: version 2.12.8
  reconstructed args: -nowarn -Yresolve-term-conflict:object

  last tree to typer: TypeTree(class Array)
       tree position: line 5 of cmd0.sc
            tree tpe: Array[Object]
              symbol: final class Array in package scala
   symbol definition: final class Array[T] extends Object (a ClassSymbol)
      symbol package: scala
       symbol owners: class Array
           call site: constructor cmd0$A in class cmd0$A in package $sess

== Source file context for tree position ==

     2   def this() = this(3)(3)
     3   def apply(i: Int) = ???
     4 }
     5 def $main() = { ammonite.repl.ReplBridge.value.Internal.combinePrints(
     6       _root_.ammonite
     7             .repl
     8             .ReplBridge
Compilation Failed

Using this(3).apply(3) as well as removing the apply-definition correctly yields a compiler error.

@SrTobi SrTobi changed the title Compiler crashes on self invokation with too many argument list on type that defines apply. Compiler crashes on self invokation with too many argument lists on class that defines apply. Feb 4, 2019

@SethTisue SethTisue changed the title Compiler crashes on self invokation with too many argument lists on class that defines apply. Compiler crashes on self invocation with too many argument lists on class that defines apply. Feb 4, 2019

@SethTisue SethTisue added this to the Backlog milestone Feb 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment