Skip to content

cmd/go2go: design corner cases when passing interface type arguments #39961

Closed as not planned
@tdakkota

Description

@tdakkota

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

$ go version
go version devel +08b9fd164c Tue Jun 30 19:00:27 2020 +0000 windows/amd64

Does this issue reproduce with the latest release?

n/a

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

  • windows/amd64
  • Go2go playground

What did you do?

This code compiles https://go2goplay.golang.org/p/-5nF8t38Ebr - it's incorrect.

But this code does not compile https://go2goplay.golang.org/p/MdJl77uLB-g.

package main

import (
	"fmt"
)

type AwesomeMap(type V interface {
	type interface{}
}) map[string]V

type A interface {
	type interface{}
	Method()
}

func main() {
	var i AwesomeMap(A)
	fmt.Println(i)
}

What did you expect to see?

Compilation error in both cases.
type interface{} can't satisfy interface {Method();}

What did you see instead?

Successful compilation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions