On Thu, May 10, 2018 at 1:00 PM roger peppe wrote:
> "The scope of a type identifier declared inside a function begins at
> the identifier in the TypeSpec and ends at the end of the innermost
> containing block."
That's it, thanks. Got bitten by the difference wrt variable decls within a
fn. T
On Thu, 10 May 2018 08:33:32 +
Jan Mercl <0xj...@gmail.com> wrote:
> This modified example from another thread does not compile:
You modified it in a pretty significant way. The original example had
type T = *T
which is a recursive type alias (which is disallowed). Your new example
has
typ
The error seems correct to me. From the spec:
"The scope of a type identifier declared inside a function begins at
the identifier in the TypeSpec and ends at the end of the innermost
containing block."
So the type declaration in main is a recursive type - the T it refers
to is not the previously
This modified example from another thread does not compile:
package main
import (
"fmt"
)
type T int
func main() {
var v T
type T *T
var w T
w = &v
*w = v
https://github.com/golang/go/issues/20219
--
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.
For more options, visit https