Skip to content

cmd/compile: internal compiler error: assertion failed #53406

Closed
@wdvxdr1123

Description

@wdvxdr1123

I also got the same error. MWE of the code I was working with:

package main

import "fmt"

type Interface[K any] interface {
	Name() string
}

type interfaceImpl[K any] struct {
	name string
}

func (i interfaceImpl[K]) Name() string {
	return i.name
}

type Type[T any, K any] struct {
	interfaceImpl[K]
}

func main() {
	a := Type[int, int]{
		interfaceImpl[int]{name: "hello"},
	}
	printName(a)
}

func printName[T any](k Type[T, int]) {
	fmt.Println(k.Name())
}

Originally posted by @arvidfm in #53254 (comment)

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

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions