/
githubmirror
/
go
Обзор
Документация
Войти
/
githubmirror
/
go
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
test/fixedbugs/issue79236b.go
33 строки
521 B
Cuong Manh Le
cmd/compile: ensure evaluating array index expression
26 май 2026, 03:25
26 май 2026, 03:25
e28acf5
Код
Авторство
О чём код?
// run // Copyright 2026 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 import "strings" type S struct { a [3]int } //go:noinline func f(i int) { var x [0]S x[i].a[1] = 3 } func main() { defer func() { r := recover() if r == nil { panic("no panic (bug)") } got := r.(error).Error() if !strings.Contains(got, "index out of range [3] ") { panic("unexpected panic: " + got) } }() f(3) }