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

"my (Str $a) = 3" should die but doesn't. #2983

Closed
p6rt opened this issue Nov 26, 2012 · 4 comments
Closed

"my (Str $a) = 3" should die but doesn't. #2983

p6rt opened this issue Nov 26, 2012 · 4 comments

Comments

@p6rt
Copy link

p6rt commented Nov 26, 2012

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

Searchable as RT115916$

@p6rt
Copy link
Author

p6rt commented Nov 26, 2012

From felix@herrmann-koenigsberg.de

Steps to reproduce​:

my (Str $a) = 3;
say $a;

What I expected​: This should die due to type errors.
What I got​: Just the output '3'.

@p6rt
Copy link
Author

p6rt commented Apr 13, 2015

From @usev6

This dies no with a typed exception X​::TypeCheck

$ perl6-m -e 'my (Str $a) = 3'
Type check failed in assignment to '$a'; expected 'Str' but got 'Int'
  in method STORE at src/gen/m-CORE.setting​:9265
  in block <unit> at -e​:1

I added a test to S04-declarations/my.t with commit Raku/roast@d561d4977c. Actually there was already a very similiar test 'my (Int $a); $a = "str"', but since I didn't want to merge both tickets (which was primarily about native types) I added this extra test which refers to this ticket.

I'm closing this ticket as 'resolved'.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Apr 13, 2015

From @usev6

This dies no with a typed exception X​::TypeCheck

$ perl6-m -e 'my (Str $a) = 3'
Type check failed in assignment to '$a'; expected 'Str' but got 'Int'
  in method STORE at src/gen/m-CORE.setting​:9265
  in block <unit> at -e​:1

I added a test to S04-declarations/my.t with commit Raku/roast@d561d4977c. Actually there was already a very similiar test 'my (Int $a); $a = "str"', but since I didn't want to merge both tickets (which was primarily about native types) I added this extra test which refers to this ticket.

I'm closing this ticket as 'resolved'.

@p6rt p6rt closed this as completed Apr 13, 2015
@p6rt
Copy link
Author

p6rt commented Apr 13, 2015

@usev6 - Status changed from 'new' 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