Skip to content

cmd/compile: generics + constant cycle causes panic in type checker #52748

@adonovan

Description

@adonovan

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

$ go version
go version go1.18.1 darwin/arm64

$ cat b.go 
package main

import "unsafe"

type S[T any] struct{}

const c = unsafe.Sizeof(S[[c]byte]{})

$ go tool compile b.go
<unknown line number>: internal compiler error: panic: unimplemented basic: invalid type (kind 0)

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

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions