Skip to content
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

Some path-dependent type does not look for its project-type extensions #17017

Closed
ftucky opened this issue Feb 27, 2023 · 3 comments
Closed

Some path-dependent type does not look for its project-type extensions #17017

ftucky opened this issue Feb 27, 2023 · 3 comments

Comments

@ftucky
Copy link

ftucky commented Feb 27, 2023

Compiler version

3.2.2 , 3.3.0-RC1

Minimized code

trait A:
	final class X

object B:
	extension (x:B#X)
		def foo = false

class B extends A:
	def bar(x:X) =
		x.foo       // fails
		(x:B#X).foo // works

class C extends B:
	def bar2(x:X) =
		x.foo       // fails
		(x:C#X).foo // works

val b = new B
val bx = new b.X
bx.foo // Works

val c = new C
val cx = new c.X
cx.foo // Works

Output

value foo is not a member of B.this.X, but could be made available as an extension method.
The following import might fix the problem:
  import Playground.B.foo

Expectation

(x:B.this.X) is a B#X and should look for extension methods on B#X.

Note, that at global scope, (bx:b.X).foo is correctly recognized.

@ftucky ftucky added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Feb 27, 2023
@szymon-rd szymon-rd added area:extension-methods and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Mar 1, 2023
@szymon-rd
Copy link
Contributor

Thank you for reporting!

@ftucky
Copy link
Author

ftucky commented Mar 21, 2023

Strong suspicion this is resolved by PR #17088.

@ftucky
Copy link
Author

ftucky commented Mar 21, 2023

Yes, bug is resolved in 3.3.1-RC1-bin-20230318-7226ba6-NIGHTLY (where #17088 is merged).
Closing as resolved.

@ftucky ftucky closed this as completed Mar 21, 2023
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