On Thu, Jun 15, 2023 at 10:16 AM christoph...@gmail.com
<christophe.mees...@gmail.com> wrote:

> It is possible to define two structures globally with mutual type dependency 
> as this:
>
> type A struct {
>     B []B
> }
>
> type B struct {
>     A A[]
> }
>
> but I just noticed that we can't do that inside a function:
>
> func Foo() {
>     type A struct {
>         B []B
>     }
>
>     type B struct {
>        A A[]
>     }
> }
>
> Is there a reason for this limitation ?

Syntax error: https://go.dev/play/p/ZOGyZyQDW0I

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAA40n-U_zMgXOrRrMzq%2BxeONRGxHzRB-vW4WWcpXzVq%2BWQoMJA%40mail.gmail.com.

Reply via email to