Skip to content

Method calls should not be allowed on paths #21788

Open
@lrytz

Description

@lrytz

3.5.1

scala> class A { class B }
scala> def f(using a: A): a.type = { println("f"); a }
scala> given a: A = new A
scala> new f.B
val res0: a.B = A$B@3921135e

Via https://discord.com/channels/632150470000902164/632628489719382036/1296041645900562455

In the quotes API it's a transparent inline def: https://github.com/scala/scala3/blob/3.5.1/library/src/scala/quoted/Quotes.scala#L18.

@sjrd said

I thought that was only allowed for transparent inline defs that inline themselves to a path

which makes sense; is it specced?

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:inlinearea:specitype:bugitype:soundnessSoundness bug (it lets us compile code that crashes at runtime with a ClassCastException)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions