[generics] Casting to an interface with type constraints produces an internal error in the go2go playground

132 views
Skip to first unread message

Alexandr Gulak

unread,
Jul 9, 2020, 9:08:17 PM7/9/20
to golan...@googlegroups.com
Expected behavior: I think it should fail on the type checking step saying we cannot have a variable of that type

Ian Lance Taylor

unread,
Jul 10, 2020, 12:41:23 AM7/10/20
to Alexandr Gulak, golang-nuts, Robert Griesemer
On Thu, Jul 9, 2020 at 6:08 PM Alexandr Gulak <lx.g...@gmail.com> wrote:
>
> Expected behavior: I think it should fail on the type checking step saying we cannot have a variable of that type
>
> Steps to reproduce: https://go2goplay.golang.org/p/RVTj-tORXip

I agree that it looks like the type checker should report an error for
that code.

Ian
Reply all
Reply to author
Forward
0 new messages