You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expected to see a compiling error or a runtime panic. Based on the golang spec as below, The method set of S shouldn't include promoted methods with receiver *T. In my example, the student shouldn't include prometed method Speak() with receiver *people.
If S contains an embedded field T, the method sets of S and *S both include promoted methods with receiver T. The method set of *S also includes promoted methods with receiver *T.
What did you see instead?
I did not see any error, and the output of my example program was as below,
I am people.
People like cake.
{{30 ben} 80}
The text was updated successfully, but these errors were encountered:
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?What did you do?
I wrote a simple golang program as follow,
What did you expect to see?
I expected to see a compiling error or a runtime panic. Based on the golang spec as below, The method set of S shouldn't include promoted methods with receiver *T. In my example, the student shouldn't include prometed method Speak() with receiver *people.
What did you see instead?
I did not see any error, and the output of my example program was as below,
The text was updated successfully, but these errors were encountered: