Skip to content

gc allows conversion from string to byte array #1866

@edsrzf

Description

@edsrzf
1. What is a short input program that triggers the error?
package main

func main() {
    var array [5]byte = [...]byte("hello")
    _ = array
}

2. What is the full compiler output?
None; it's successful.

gccgo and gofmt both give errors on this code and I don't believe the spec allows for it.

3. What version of the compiler are you using?  (Run it with the -V flag.)
6g version release.r57.1 8482+

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