/
githubmirror
/
go
Обзор
Документация
Войти
/
githubmirror
/
go
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
test/fixedbugs/issue52072.go
32 строки
415 B
Cuong Manh Le
cmd/compile: do not devirtualize defer/go calls
07 сен 2022, 01:14
07 сен 2022, 01:14
c82304b
Код
Авторство
О чём код?
// run // Copyright 2022 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 main type I interface{ M() } type T struct { x int } func (T) M() {} var pt *T func f() (r int) { defer func() { recover() }() var i I = pt defer i.M() r = 1 return } func main() { if got := f(); got != 1 { panic(got) } }