Skip to content

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

Closed
@ftucky

Description

@ftucky

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions