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

fails with ::MySig ::= :(Num, Str) #809

Closed
p6rt opened this issue Mar 20, 2009 · 5 comments
Closed

fails with ::MySig ::= :(Num, Str) #809

p6rt opened this issue Mar 20, 2009 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Mar 20, 2009

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

Searchable as RT64022$

@p6rt
Copy link
Author

p6rt commented Mar 20, 2009

From amoc.yn@gmail.com

<amoc> rakudo​: my :​:MyType :​:= :(Num, Str)
<p6eval> rakudo c26021​: OUTPUT«ResizablePMCArray​: Can't pop from an empty
array!␤current instr.​: 'parrot;Perl6;Grammar;Actions;typename' pc -3015048
((unknown file)​:-1)␤»

<amoc> rakudo​: :​:MyType :​:= :(Num, Str)
<p6eval> rakudo c26021​: OUTPUT«too few arguments passed (0) - 2 params
expected␤current instr.​: '_block14' pc 40 (EVAL_18​:28)␤»

<amoc> rakudo​: :​:MyType := Int
<p6eval> rakudo c26021​: RESULT«Int»

<jnthn> rakudo​: :​:MyType := Int; my MyType $x = 42; say "ok"; $x = "OMG";
say $x;
<p6eval> rakudo c26021​: OUTPUT«ok␤Type mismatch in assignment.␤current
instr.​: 'die' pc 15960 (src/builtins/control.pir​:204)␤»

but from​: http://perlcabal.org/syn/S02.html#Names_and_Variables

A signature object (Signature) may be created with colon-prefixed parens​:
  my :​:MySig :​:= :(Int, Num, Complex, Status)

@p6rt
Copy link
Author

p6rt commented Jul 28, 2010

@coke - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Sep 9, 2011

From @bbkr

NOM

bbkr​:nom bbkr$ ./perl6 -e 'my :​:MyType :​:= :(Num, Str)'
===SORRY!===
Malformed my at line 1, near "​::MyType :"

@p6rt
Copy link
Author

p6rt commented Dec 30, 2012

From @moritz

It now parse-errors as it should, and not with an internal error message
(though not quite in the way that STD does it). Closing now.

@p6rt
Copy link
Author

p6rt commented Dec 30, 2012

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

@p6rt p6rt closed this as completed Dec 30, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant