Skip to content

cmd/compile: misleading error trying to convert to pointer to generic #79883

@dominikh

Description

@dominikh

For invalid conversions such as

func foo[A [1]int]() {
	var s string
	_ = (*A)(s)
}

the compiler reports

/tmp/qux.go:5:11: cannot convert s (variable of type string) to type *A: string does not implement *A (type *A is pointer to interface, not interface)

but the issue isn't really about interfaces.

Metadata

Metadata

Assignees

No one assigned

    Labels

    compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions