From 0ba4eba8645258f5f2a572ded7c673d2c24c881e Mon Sep 17 00:00:00 2001 From: Emmanuel Odeke Date: Mon, 30 Oct 2017 22:44:14 -0700 Subject: [PATCH] cmd/compile: test for omitted ICE diagnostics after normal messages Updates #22389 @mdempsky's CL 70850 fixed the unnecessary compile stack trace printing during ICE diagnostics. This CL adds a test to lock in this behavior. Change-Id: I9ce49923c80b78cb8c0bb5dc4af3c860a43d63ba Reviewed-on: https://go-review.googlesource.com/74630 Run-TryBot: Emmanuel Odeke TryBot-Result: Gobot Gobot Reviewed-by: Matthew Dempsky --- test/fixedbugs/issue22389.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/fixedbugs/issue22389.go diff --git a/test/fixedbugs/issue22389.go b/test/fixedbugs/issue22389.go new file mode 100644 index 0000000000..706b44941c --- /dev/null +++ b/test/fixedbugs/issue22389.go @@ -0,0 +1,18 @@ +// errorcheck + +// Copyright 2017 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 + +type Foo struct{} + +func (f *Foo) Call(cb func(*Foo)) { + cb(f) +} + +func main() { + f := &Foo{} + f.Call(func(f) {}) // ERROR "f is not a type" +}