Skip to content

cmd/compile: better error message for invalid for i,j,k := range #50372

@SuryaprakashBS

Description

@SuryaprakashBS

Does this issue reproduce with the latest release?

yes

What did you do?

package main

var map1 map[string]int

var map2 map[string]int

func main() {
    map1["a"] = 1
    map1["b"] = 2
    
    for i,j,k := range map1{
    	map2[k] = j
    } 	
}
// https://go.dev/play/p/UUnsd-FmrT2

What did you see?

./prog.go:15:14: internal compiler error: expected an error about map2[k]

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