Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rakudo allows instantiating subtypes, shouldn't #1337

Closed
p6rt opened this issue Oct 1, 2009 · 8 comments
Closed

Rakudo allows instantiating subtypes, shouldn't #1337

p6rt opened this issue Oct 1, 2009 · 8 comments

Comments

@p6rt
Copy link

p6rt commented Oct 1, 2009

Migrated from rt.perl.org#69518 (status was 'resolved')

Searchable as RT69518$

@p6rt
Copy link
Author

p6rt commented Oct 1, 2009

From @masak

<masak> rakudo​: subset Foo of Object where Str | Int; my $foo =
Foo.new; say $foo.WHAT
<p6eval> rakudo ffe648​: OUTPUT«()␤»
* masak submits another rakudobug

Should probably be a compile-time error, even.

@p6rt
Copy link
Author

p6rt commented Aug 18, 2010

From @coke

On Thu Oct 01 03​:44​:43 2009, masak wrote​:

<masak> rakudo​: subset Foo of Object where Str | Int; my $foo =
Foo.new; say $foo.WHAT
<p6eval> rakudo ffe648​: OUTPUT«()␤»
* masak submits another rakudobug

Should probably be a compile-time error, even.

This better?

00​:30 <[Coke]> rakudo​: subset Foo of Object where Str | Int; my $foo = Foo.new;
  say $foo.WHAT
00​:30 <p6eval> rakudo 67778a​: OUTPUT«===SORRY!===␤Confused at line 22, near
  "subset Foo"␤»

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Aug 18, 2010

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Aug 18, 2010

From @masak

On Tue Aug 17 21​:33​:18 2010, coke wrote​:

On Thu Oct 01 03​:44​:43 2009, masak wrote​:

<masak> rakudo​: subset Foo of Object where Str | Int; my $foo =
Foo.new; say $foo.WHAT
<p6eval> rakudo ffe648​: OUTPUT«()␤»
* masak submits another rakudobug

Should probably be a compile-time error, even.

This better?

00​:30 <[Coke]> rakudo​: subset Foo of Object where Str | Int; my $foo =
Foo.new;
say $foo.WHAT
00​:30 <p6eval> rakudo 67778a​: OUTPUT«===SORRY!===␤Confused at line 22,
near
"subset Foo"␤»

No, that's just the reported problem being hidden by an upstream syntax error caused by
Object having since been renamed Mu.

<masak> rakudo​: subset Foo of Mu where Str | Int; my $foo = Foo.new; say $foo.WHAT
<p6eval> rakudo 67778a​: OUTPUT«Mu()␤»

The original problem persists.

@p6rt
Copy link
Author

p6rt commented Sep 11, 2011

From @bbkr

NOM

bbkr​:nom bbkr$ ./perl6 -e 'subset Foo of Mu where Str | Int; my $foo =
Foo.new; say $foo.WHAT'
You cannot create an instance of this type
  in method bless at src/gen/CORE.setting​:504
  in method new at src/gen/CORE.setting​:491

@p6rt
Copy link
Author

p6rt commented Sep 11, 2011

From @bbkr

2​:34
bbkr
masak​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=69518 - is this
expected behavior?
2​:35
jnthn
bbkr​: Looks right to me, fwiw.

2​:36
jnthn
Could awesomize the error a little.
2​:36
(to include the name of the type)
But that aside, it's refusing to instantiate a subtype.

2​:37
masak
aye.

2​:37
bbkr
should I write test and close or rename to "LTA error message" issue
2​:37
jnthn
bbkr​: Write a couple of tests. One that it works, another that the error
contains the type name.

2​:37
masak
I say the ticket as it stands is closable (after tests)

@p6rt
Copy link
Author

p6rt commented Sep 26, 2011

From @moritz

now tested in S02-types/subset.t

@p6rt
Copy link
Author

p6rt commented Sep 26, 2011

@moritz - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant