Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go2go: plus operation is not allowed to string and int #39647

Closed
vearutop opened this issue Jun 17, 2020 · 1 comment
Closed

cmd/go2go: plus operation is not allowed to string and int #39647

vearutop opened this issue Jun 17, 2020 · 1 comment

Comments

@vearutop
Copy link
Contributor

@vearutop vearutop commented Jun 17, 2020

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

https://go2goplay.golang.org/

$ go version
devel +ad307489d4 Tue Jun 16 05:49:35 2020 +0000

Does this issue reproduce with the latest release?

Yes.

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

https://go2goplay.golang.org/

go env Output
$ go env

What did you do?

https://go2goplay.golang.org/p/eJ9uY08prqs

package main

import (
	"fmt"
)

type Plussable interface {
	type string, int
}

func Print(type T Plussable)(s1 T, s2 T) T {
	return s1 + s2
}
func main() {
	fmt.Print(Print("Hello, ", "playground\n"))
}

What did you expect to see?

Hello, playground

What did you see instead?

type checking failed for main
prog.go2:12:9: invalid operation: operator + not defined for s1 (variable of type T)

If I remove int from enumeration it works ok, also it works well if I remove string and add few more int*.

@martisch
Copy link
Contributor

@martisch martisch commented Jun 17, 2020

Duplicate of: #39623

@martisch martisch closed this Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.