Skip to content

cmd/compile: error message for invalid type switch cases less helpful in Go1.18 #50965

@griesemer

Description

@griesemer
	var i I
	var s string

	switch i {
	case s:
	}

produces

invalid operation: cannot compare s == i (mismatched types string and I)

The compiler at 1.17 reported

invalid case s in switch on i (mismatched types string and I)

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions