| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
This still ICE when you try to fold TFlag of a type declared in an other package which embeds an anonymous struct embeding a type with methods.
---
I couldn't get my repro to work so I've asked an LLM to do so and it found one:
```
From 465ad4412b559a88b7d5bc28383a525a5f9b46df Mon Sep 17 00:00:00 2001
From: Jorropo <jorro...@gmail.com>
Date: Mon, 10 Aug 2026 02:26:45 +0200
Subject: [PATCH] test: add an other repro of 80450
Change-Id: I871338d9bffcf6b5a264b40751192b8ccab5f923
---
test/fixedbugs/issue80450d.dir/a.go | 15 ++++++++++
test/fixedbugs/issue80450d.dir/b.go | 45 +++++++++++++++++++++++++++++
test/fixedbugs/issue80450d.go | 7 +++++
3 files changed, 67 insertions(+)
create mode 100644 test/fixedbugs/issue80450d.dir/a.go
create mode 100644 test/fixedbugs/issue80450d.dir/b.go
create mode 100644 test/fixedbugs/issue80450d.go
diff --git a/test/fixedbugs/issue80450d.dir/a.go b/test/fixedbugs/issue80450d.dir/a.go
new file mode 100644
index 0000000000..01eb1a01ba
--- /dev/null
+++ b/test/fixedbugs/issue80450d.dir/a.go
@@ -0,0 +1,15 @@
+// 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 target
+
+type Base struct{}
+
+func (Base) M() {}
+
+// Target is a defined pointer type: ReceiverBaseType(Target) is nil,
+// while its element is an unnamed struct with promoted methods.
+type Target *struct{ Base }
+
+var P Target
diff --git a/test/fixedbugs/issue80450d.dir/b.go b/test/fixedbugs/issue80450d.dir/b.go
new file mode 100644
index 0000000000..5a1810a926
--- /dev/null
+++ b/test/fixedbugs/issue80450d.dir/b.go
@@ -0,0 +1,45 @@
+// 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 (
+ "unsafe"
+
+ target "./a"
+)
+
+// abiType and ptrType mirror the layout of internal/abi.Type and
+// internal/abi.PtrType, so that the loads below hit the descriptor
+// field offsets the compiler constant-folds (Elem, then TFlag of the
+// element's descriptor).
+type abiType struct {
+ Size_ uintptr
+ PtrBytes uintptr
+ Hash uint32
+ TFlag uint8
+ Align_ uint8
+ FieldAlign_ uint8
+ Kind_ uint8
+ Equal func(unsafe.Pointer, unsafe.Pointer) bool
+ GCData *byte
+ Str int32
+ PtrToThis int32
+}
+
+type ptrType struct {
+ abiType
+ Elem *abiType
+}
+
+type eface struct {
+ typ *ptrType
+ data unsafe.Pointer
+}
+
+func main() {
+ var x any = target.P
+ e := (*eface)(unsafe.Pointer(&x))
+ println(e.typ.Elem.TFlag)
+}
diff --git a/test/fixedbugs/issue80450d.go b/test/fixedbugs/issue80450d.go
new file mode 100644
index 0000000000..c791559df4
--- /dev/null
+++ b/test/fixedbugs/issue80450d.go
@@ -0,0 +1,7 @@
+// compiledir
+
+// 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 ignored
--
2.55.0
```
It's hard to get the right inlining to trigger it without using `reflect` but I'm not confident the bug is not reachable.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
*it's hard to get the right `reflect` inlining to trigger it without using `unsafe`
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
I can't get it to reproduce without using unsafe or internal/abi itself to poke at things. Nor did letting an LLM churn looking for a repro work either. But, with a repro similar to yours, I did at least come up with a fix.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |