-
Notifications
You must be signed in to change notification settings - Fork 17.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dev.go2go] go/types: don't panic if receiver type arguments cannot b…
…e inferred This can happen due to earlier errors. This change avoids the panic but reports a follow-up error. Not ideal, but good enough for now. Fixes #40056. Change-Id: I500d4fc2b058cdc70f28883ff8d004df4b43fe4e Reviewed-on: https://go-review.googlesource.com/c/go/+/241130 Reviewed-by: Robert Griesemer <[email protected]>
- Loading branch information
Showing
2 changed files
with
22 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright 2020 The Go Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
package p | ||
|
||
func _() { | ||
NewS() /* ERROR cannot infer T */ .M() | ||
} | ||
|
||
type S struct {} | ||
|
||
func NewS(type T)() *S | ||
|
||
func (_ *S /* ERROR S is not a generic type */ (T /* ERROR cannot infer T */ )) M() |