Skip to content

spec: clarify meaning of alias decls in sequence of "enum" const declaration #17784

Description

@griesemer
package main

import "math"
import "fmt"

const (
	a = iota
	b
	c => math.Pi
	d
)

func main() {
	fmt.Println(a, b, c, d)
}

prints

0 1 3.141592653589793 2

It probably shouldn't be allowed in the first place. Certainly the output is wrong (iota should be incremented with each semicolon).

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions