Skip to content

cmd/compile: internal compiler error "not lowered: ArrayMake0" for pointer-shaped struct with zero-sized array field #77936

@Splizard

Description

@Splizard

Go 1.26.0 regression

package main

type T struct {
	_ [0]*int
	p *int
}

type W struct{ T }

//go:noinline
func f(n *int) W { return W{T{p: n}} }

//go:noinline
func g(w W) any { return w }

func main() {
	n := 1
	x := f(&n)
	switch g(x) {
	case x:
		println("x")
	}
}

https://go.dev/play/p/fsNLSEBlIpB

./prog.go:20:2: internal compiler error: 'main': not lowered: v7, ArrayMake0 ARRAY

Please file a bug report including a short program that triggers the error.
https://go.dev/issue/new

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues describing a possible bug in the Go implementation.compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions