Skip to content

Misleading error on import from named tuple #25120

@kubukoz

Description

@kubukoz

Compiler version

3.8.1, 3.nightly

Minimized

code

//> using scala 3.nightly

object demo {
  val p: (name: String, age: Int) = ???
  import p.name
}

Output

value name is not a member of (name : String, age : Int)

Expectation

Either:

  • "Importing named members from named tuples is not allowed" error
  • no errors, the name property is imported

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:named-tuplesIssues tied to the named tuples feature.area:reportingError reporting including formatting, implicit suggestions, etcbetter-errorsIssues concerned with improving confusing/unhelpful diagnostic messagesitype:bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions