3 // Copyright 2017 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
7 // The compiler was panicking on the wrong line number, where
8 // the panic was occurring in an inlined call.
21 func (w Wrapper) Get(i int) int {
29 panic("bounds check didn't fail")
31 stk := string(debug.Stack())
32 if !strings.Contains(stk, "issue22083.go:40") {
33 panic("wrong stack trace: " + stk)
36 foo := Wrapper{a: []int{0, 1, 2}}
40 _ = foo.Get(3) // stack trace should mention this line