Skip to content

Applied constructor type "not a valid prefix" #23690

@bishabosha

Description

@bishabosha

Compiler version

3.7.2

Minimized code

//> using scala 3.7.2
//> using options -language:experimental.modularity

class Foo(tracked val pattern: String):
  type Fields = pattern.type // e.g. Fields on a Selectable

type Bar = (Foo{val pattern: "/hello/:name"})#Fields
type Qux = (Foo("/hello/:name"))#Fields // error

Output

type Qux = (Foo("/hello/:name"))#Fields // error
// ^ Foo{val pattern: ("/hello/:name" : String)} is not a valid type prefix, since it is not an immutable path

Expectation

applied constructor type in Qux is a syntax sugar for the same type of Bar, so should compile

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