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

Type variable doesn't match in signature to 'for' loop in Rakudo #2886

Closed
p6rt opened this issue Sep 3, 2012 · 6 comments
Closed

Type variable doesn't match in signature to 'for' loop in Rakudo #2886

p6rt opened this issue Sep 3, 2012 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Sep 3, 2012

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

Searchable as RT114724$

@p6rt
Copy link
Author

p6rt commented Sep 3, 2012

From @masak

<skids> r​: sub f (​::T $g) { for ($g) -> T $h { } }; f("blah");
<p6eval> rakudo 962b9b​: OUTPUT«Nominal type check failed for parameter
'$h'; expected T but got Str instead [...]
<masak> r​: sub f (​::T $g) { say T.^name }; f("blah")
<p6eval> rakudo 962b9b​: OUTPUT«Str␤»
<masak> weyrd.
<skids> I do manage to run into some of the weirder ones, yes. :-)
<masak> r​: sub f (​::T $g) { say $g ~~ Str; say $g ~~ T; say Str ~~ T
}; f("blah")
<p6eval> rakudo 962b9b​: OUTPUT«True␤True␤True␤»
<skids> it only happens in the for signature, every other place it works.
<masak> r​: sub f (​::T $g) { for $g -> $h where { say Str ~~ T } {} }; f("blah")
<p6eval> rakudo 962b9b​: OUTPUT«True␤»
<masak> curious.
* masak submits rakudobug

@p6rt
Copy link
Author

p6rt commented Jul 10, 2015

From @coke

On Mon Sep 03 09​:15​:38 2012, masak wrote​:

<skids> r​: sub f (​::T $g) { for ($g) -> T $h { } }; f("blah");
<p6eval> rakudo 962b9b​: OUTPUT«Nominal type check failed for parameter
'$h'; expected T but got Str instead [...]
<masak> r​: sub f (​::T $g) { say T.^name }; f("blah")
<p6eval> rakudo 962b9b​: OUTPUT«Str␤»
<masak> weyrd.
<skids> I do manage to run into some of the weirder ones, yes. :-)
<masak> r​: sub f (​::T $g) { say $g ~~ Str; say $g ~~ T; say Str ~~ T
}; f("blah")
<p6eval> rakudo 962b9b​: OUTPUT«True␤True␤True␤»
<skids> it only happens in the for signature, every other place it
works.
<masak> r​: sub f (​::T $g) { for $g -> $h where { say Str ~~ T } {} };
f("blah")
<p6eval> rakudo 962b9b​: OUTPUT«True␤»
<masak> curious.
* masak submits rakudobug

Looks like this is closable with tests​:

$ ./perl6

sub f (​::T $g) { for ($g) -> T $h { } }; f("blah");

# no error

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Jul 10, 2015

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

@p6rt
Copy link
Author

p6rt commented Jul 10, 2015

From @usev6

I added a test to S06-signature/type-capture.t with commit Raku/roast@e26327b1b1

I'm closing this ticket as 'resolved'.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Jul 10, 2015

From @usev6

I added a test to S06-signature/type-capture.t with commit Raku/roast@e26327b1b1

I'm closing this ticket as 'resolved'.

@p6rt
Copy link
Author

p6rt commented Jul 10, 2015

@usev6 - 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