1 // Copyright 2023 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 // WARNING: Please avoid updating this file.
6 // See the warning in ../devirt.go for more details.
12 type Multiplier interface {
13 Multiply(a, b int) int
18 func (Mult) Multiply(a, b int) int {
19 for i := 0; i < 1000; i++ {
27 func (NegMult) Multiply(a, b int) int {
28 for i := 0; i < 1000; i++ {
34 // N.B. Different types than AddFunc to test intra-line disambiguation.
35 type MultFunc func(int64, int64) int64
37 func MultFn(a, b int64) int64 {
41 func NegMultFn(a, b int64) int64 {
46 func MultClosure() MultFunc {
47 // Explicit closure to differentiate from AddClosure.
49 return func(a, b int64) int64 {
50 return a * b * int64(c)
55 func NegMultClosure() MultFunc {
57 return func(a, b int64) int64 {
58 return -1 * a * b * int64(c)