const std = @import("std");
const T = union {
X: struct {
fn foo(_: @This()) void {}
},
Y: struct {
fn foo(_: @This()) void {}
},
};
pub fn main() !void {
var t: T = undefined;
t.X = .{};
t.foo(); // error: no field or member function named 'foo' in 'T'
}