Skip to content

x/tools/go/types: compiles invalid program with overflow #11368

Closed
@dvyukov

Description

@dvyukov

On the following program:

package main
func main() {
    var a = -("0"[0])
    println(a)
}

ssadump -run outputs:

208

The program is invalid and must not be compiled (type of "0"[0] is byte, -byte is an overflow).

on commit e9a746d

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