* Brian Candler <[email protected]> [210305 10:21]:
> There is a flip side to that: if you add the return statements, then 
> ForLoop1() gives an error due to unreachable code!
> https://play.golang.org/p/0bajnJWTz7U
> 
> So you can't win either way.  I think this implies that if the behaviour 
> were changed now, it would break the go compatibility promise.

The Go compatibility promise does not apply to fixing bugs where the
compiler does not behave according to the language spec.

>From https://golang.org/doc/go1compat#expectations:

  Bugs. If a compiler or library has a bug that violates the
  specification, a program that depends on the buggy behavior may break
  if the bug is fixed. We reserve the right to fix such bugs. 

I would consider this a good candidate for invoking this clause.  Bugs
where the compiler incorrectly flags code as being reachable or
unreachable and fails to compile the code because of such a bug are
important to fix, IMO.

Would someone who has a github account please file an issue for this?

Thanks...Marvin

-- 
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/20210305155245.kvg3u6fclxde7ttr%40basil.wdw.

Reply via email to