Re: cannot create an instance of subset type

2020-07-11 Thread Ben Davies
It looks like you're trying to create an alias for a type. I'd use a constant for this, not a subset, for reasons Brad has already explained. Your code runs fine for me when DEF is written like my constant DEF = ABC.

Re: cannot create an instance of subset type

2020-07-11 Thread Elizabeth Mattijsen
> On 10 Jul 2020, at 23:37, Brad Gilbert wrote: > I honestly think that there is an argument to be made that it shouldn't even > be possible to write a `subset` without a `where` clause. Making the "where" clause non-optional, is remarkably simple: removing a '?' However, there appear to be qui

Re: cannot create an instance of subset type

2020-07-11 Thread Marcel Timmerman
On 2020-07-10 23:37, Brad Gilbert wrote: Subset types are not object types. A subset is basically a bit of checking code and base type associated with a new type name. In something like:     my ABC $a .= new; That is exactly the same as:     my ABC $a = ABC.new; Well there is no functiona

Re: cannot create an instance of subset type

2020-07-10 Thread Brad Gilbert
Subset types are not object types. A subset is basically a bit of checking code and base type associated with a new type name. In something like: my ABC $a .= new; That is exactly the same as: my ABC $a = ABC.new; Well there is no functional `.new` method on any subset types, so `DEF.