Skip to content

Weird interaction between given opaque types, extension method and repl #7181

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
johnynek opened this issue Sep 8, 2019 · 1 comment
Closed

Comments

@johnynek
Copy link

johnynek commented Sep 8, 2019

minimized code

package Repro     
                                      
opaque type Foo = Int                 
                                                     
object Foo {                                         
  def empty: Foo = 0                                 
}                                                         
                                               
given FooOps {                                 
  def (f: Foo) +(that: Int): Foo = f + that    
} 

This code compiles, but in the repl you see:

sbt:dotty-example-project> console

scala> import Repro.Foo

scala> Foo.empty
1 |Foo.empty
  |^^^
  |Not found: Foo

Note, if you remove the given FooOps { then it Foo.empty works. So, this is somehow an interaction with the FooOps.

expectation

I expect that if I can compile it, I can reference it.

This was on 0.18.1-RC1

@liufengyun
Copy link
Contributor

The issue cannot be reproduced.

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