Skip to content

Compiler fails to inline #3488

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
allanrenucci opened this issue Nov 16, 2017 · 1 comment
Closed

Compiler fails to inline #3488

allanrenucci opened this issue Nov 16, 2017 · 1 comment

Comments

@allanrenucci
Copy link
Contributor

The following code snippet does not compile with Dotty:

class Set[A] {

  def incl(elem: A): Set[A] = ???

  inline final def + (elem: A): Set[A] = incl(elem)
}

object Set {
  def apply[A](elems: A*): Set[A] = ???
}

class Test {
  Set(1) + 1
}
-- Error: tests/allan/Test.scala:13:9 ------------------------------------------
13 |  Set(1) + 1
   |  ^^^^^^^^^^
   |undefined: Set_this.incl # 191: TermRef(TermRef(NoPrefix,val Set_this),incl[with sig Signature(List(java.lang.Object),Set)])

It compiles without the inline keyword.

@odersky
Copy link
Contributor

odersky commented Jan 2, 2018

Fixed by #3494

@odersky odersky closed this as completed Jan 2, 2018
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

2 participants