blob: 6466c2b093877d39ca6af5075bc340e0ad47461b [file] [log] [blame]
David Lazar5d1b53a2016-11-28 17:39:31 -05001// errorcheck -0 -m -l=3
2
3// Copyright 2016 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.
6
7// Test more aggressive inlining (-l=3 allows variadic functions)
8// See issue #18116.
9
10package foo
11
12func head(xs ...string) string { // ERROR "can inline head" "leaking param: xs to result"
13 return xs[0]
14}
15
16func f() string { // ERROR "can inline f"
17 x := head("hello", "world") // ERROR "inlining call to head" "\[\]string literal does not escape"
18 return x
19}