Skip to content

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

Closed

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)

Activity

  1. added
    NeedsFixThe path to resolution is known, but the work has not been done.
    on Feb 2, 2022
  2. added this to the Go1.18 milestone on Feb 2, 2022
  3. self-assigned this
    on Feb 2, 2022
  4. gopherbot commented on Feb 2, 2022

    @gopherbot
    Contributor

    Change https://golang.org/cl/382354 mentions this issue: cmd/compile/internal/types2: better error messages for type switches

  5. locked and limited conversation to collaborators on Jun 22, 2023
  6. added a commit that references this issue on Apr 29, 2024
    63e8331
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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