Skip to content

Cannot select from named tuple literal #21413

Closed
@prolativ

Description

@prolativ

Compiler version

3.5.0
3.6.0-RC1-bin-20240821-a2c53a1-NIGHTLY

Minimized code

import scala.language.experimental.namedTuples

val x = (aaa = 1).aaa

Output

-- [E007] Type Mismatch Error: /tmp/NamedTuple.scala:3:18 ----------------------
  3 |val x = (aaa = 1).aaa
    |        ^^^^^^^^^^^^^
    |        Found:    Tuple1[Int]
    |        Required: (x$proxy2 : Tuple1[Int])
    |---------------------------------------------------------------------------
    |Inline stack trace
    |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    |This location contains code that was inlined from NamedTuple.scala:40
    |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    |This location contains code that was inlined from NamedTuple.scala:40
    |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    |This location contains code that was inlined from NamedTuple.scala:40
     ---------------------------------------------------------------------------
    |
    | longer explanation available when compiling with `-explain`

Expectation

This should compile successfully

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions