Skip to content

6g fails to compile a receive expression #1139

@gopherbot

Description

@gopherbot

by hurtonm:

What steps will reproduce the problem?

Try to compile the following program:

package main

import "fmt"

type flag struct {
        a bool
}

func main() {
        var f flag
        c := make(chan bool)
        select {
        case f.a = <-c:
                fmt.Printf("%+v\n", f)
        }
}

What is the expected output?

The file should compile.

What do you see instead?
select.go:13: syntax error: unexpected =, expecting : or comma
select.go:16: syntax error: unexpected }

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
Debian Linux

Which revision are you using?  (hg identify)
31014c5bd9ea tip

Please provide any additional information below.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions