/
githubmirror
/
go
Обзор
Документация
Войти
/
githubmirror
/
go
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
test/fixedbugs/issue65962.go
48 строк
625 B
khr@golang.org
runtime: don't re-initialize itab while looking for missing function
29 фев 2024, 21:30
29 фев 2024, 21:30
2589a89
Код
Авторство
О чём код?
// run // Copyright 2024 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 func main() { test1() test2() } type I interface { f() g() h() } //go:noinline func ld[T any]() { var x I if _, ok := x.(T); ok { } } func isI(x any) { _ = x.(I) } func test1() { defer func() { recover() }() ld[bool]() // add <bool,I> itab to binary _ = any(false).(I) } type B bool func (B) f() { } func (B) g() { } func test2() { defer func() { recover() }() ld[B]() // add <B,I> itab to binary _ = any(B(false)).(I) }