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
Given an imported interface with a private method, a variable of that imported interface
type can be assigned to a local variable with a local interface type of the same
structure through the use of a type assertion. This makes it possible to call a private
method in another package.
The attached files document and illustrate the problem. To execute: copy the files p.go
and main.go into a new directory and run:
6g p.go && 6g main.go && 6l main.6 && 6.out
The output is:
main.Implementation.private()
p.Implementation.private()
but in fact it should not compile.
Attachments:
The text was updated successfully, but these errors were encountered: