Skip to content

Missing relevance check for select in patterns #3812

Closed
@liufengyun

Description

@liufengyun

Arguably, all of them should be invalid.

    val x = 42
    val Y = "h"

    x match { case { "h" }.toString => println(42) }  // ok
    x match { case { "h".toString } => println(42) }  // error
    x match { case Y => println(42) }  // error
    x match { case Y.toString => println(42) }  // ok

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions