blob: 19cfac4a435c38d86439289cbd8354ac300ce93c [file] [log] [blame]
This test verifies the fix for golang/go#43616: renaming mishandles embedded
fields.
-- p.go --
package issue43616
type foo int //@rename("foo", "bar", fooToBar),preparerename("oo","foo","foo")
var x struct{ foo } //@renameerr("foo", "baz", "rename the type directly")
var _ = x.foo //@renameerr("foo", "quux", "rename the type directly")
-- @fooToBar/p.go --
@@ -3 +3 @@
-type foo int //@rename("foo", "bar", fooToBar),preparerename("oo","foo","foo")
+type bar int //@rename("foo", "bar", fooToBar),preparerename("oo","foo","foo")
@@ -5 +5 @@
-var x struct{ foo } //@renameerr("foo", "baz", "rename the type directly")
+var x struct{ bar } //@renameerr("foo", "baz", "rename the type directly")
@@ -7 +7 @@
-var _ = x.foo //@renameerr("foo", "quux", "rename the type directly")
+var _ = x.bar //@renameerr("foo", "quux", "rename the type directly")