Hallöchen!
Kurtis Rader writes:
> This has nothing to do with generics. It is a FAQ regarding the
> conversion of a container type value. You cannot modify the type of
> the object in a container in a called context. This has been true
> before generics was introduced. Ignoring generics what do you think
> should happen if you call a function that requires a `[]any` slice
> and pass it a `[]float64` slice? Consider this pre-generic example:
>
> package main
>
> func do([]any) {
> }
>
> func main() {
> var a []float64
> do(a)
> }
Naively, I would have expected that the same happens as with my
first example.
Regards,
Torsten.
--
Torsten Bronger
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/golang-nuts/87pm1mpl07.fsf%40physik.rwth-aachen.de.