Skip to content

Cannot inline functional interface as parameter #8845

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
edolgy opened this issue Apr 30, 2020 · 3 comments · Fixed by #8853
Closed

Cannot inline functional interface as parameter #8845

edolgy opened this issue Apr 30, 2020 · 3 comments · Fixed by #8853

Comments

@edolgy
Copy link

edolgy commented Apr 30, 2020

  trait IntToLong:
    def apply(v: Int) : Long

  inline def convert1(       f: IntToLong) = ???
  inline def convert2(inline f: IntToLong) = ???

  convert1(_ * 10)  // Compiles Fine
  convert2(_ * 10)  // Error:  Found: Int => Long, Required: IntToLong @InlineParam

Is this supposed to work at all?

@nicolasstucki
Copy link
Contributor

It should work.

@nicolasstucki
Copy link
Contributor

Workaround

convert2(x => x * 10)

nicolasstucki added a commit to dotty-staging/dotty that referenced this issue May 1, 2020
@nicolasstucki nicolasstucki linked a pull request May 1, 2020 that will close this issue
@edolgy
Copy link
Author

edolgy commented May 1, 2020

The workaround does not help (same result). The problem is probably deeper

nicolasstucki added a commit to dotty-staging/dotty that referenced this issue May 2, 2020
smarter added a commit that referenced this issue May 3, 2020
Fix #8845: Strip annots from proto when checking SAM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants