1// Copyright 2020 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. 4 5// Test that a live type's method is not live even if 6// it matches an interface method, as long as the interface 7// method is not used. 8 9package main 10 11type T int 12 13//go:noinline 14func (T) M() {} 15 16type I interface{ M() } 17 18var p *T 19var pp *I 20 21func main() { 22 p = new(T) // use type T 23 pp = new(I) // use type I 24 *pp = *p // convert T to I, build itab 25} 26