Skip to content

cmd/compile: cannot use .this ( type *T[interface{}]) as type T[go.shape.interface {}_0] in T[go.shape.interface {}_0].Method #50486

@csgura

Description

@csgura

What version of Go are you using (go version)?

$ go version
go version devel go1.18-07525e1 Fri Jan 7 00:15:59 2022 +0000 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

The gotip playground

What did you do?

https://gotipplay.golang.org/p/vuF7acfKTIv

What did you expect to see?

No Error.

What did you see instead?

# goerror
<autogenerated>:1: cannot use .this (type *fp.Seq[interface {}]) as type fp.Seq[go.shape.interface {}_0] in argument to fp.Seq[go.shape.interface {}_0].Append
<autogenerated>:1: cannot use .this (type *fp.Seq[interface {}]) as type fp.Seq[go.shape.interface {}_0] in argument to fp.Seq[go.shape.interface {}_0].Iterator
<autogenerated>:1: cannot use .this (type *fp.Seq[interface {}]) as type fp.Seq[go.shape.interface {}_0] in argument to fp.Seq[go.shape.interface {}_0].Size

If I remove ToSeq or Map method of Iterator, the error goes away.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.genericsIssue is related to generics

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions