cmd/compile: return LITERAL on INDEXMAP when map and key are LITERALs #35763
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Given
When compiled, the compiler will add the different map initialisations methods and assign the different values, then call
mapaccess1
.I believe this should not be the case when the map is an OMAPLIT and the key is a LITERAL defined in the map.
The compiler at compile-time can detect this and change the INDEXMAP operation to LITERAL.
The above code should be similar to this one:
What version of Go are you using (
go version
)?The text was updated successfully, but these errors were encountered: