On Fri, Feb 11, 2022 at 5:06 PM 'Axel Wagner' via golang-nuts
<golang-nuts@googlegroups.com> wrote:

> FYI I went ahead and filed https://github.com/golang/go/issues/51145

I must be missing something because I still don't understand what the
problem is. The syntax `type A[B]C` can be reduced both in Go1.17 and
Go1.18 in only way - it's declaring an array type A, having B elements
of type C. Because B must be a constant expression, which `float64`,
unless redefined, is not, the error message produced is complete and
unambiguous.

Compiler error messages say what the error is, their purpose is not to
explain the specification. The intended reader of the error message is
supposed to understand the message in context of the language
specification, i.e. in this case be aware that the code declares an
array type, and expects an expression where a type `float64` was found
instead.

FTR: To have it explicit, it has nothing to do with type parameters,
they have syntax incompatible with this given example.

-- 
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-VRf2fBrrRCmDMekyEqQNexw0o%2BBTksZXq3sGO4j3OQfg%40mail.gmail.com.

Reply via email to