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 Captures Leaking out Sometimes #1596

Open
zoffixznet opened this Issue Mar 7, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@zoffixznet
Contributor

zoffixznet commented Mar 7, 2018

It's possible the error is due to nqp-ish hackery going on our Rationals, but figured I'd file it.

Notice the DeT in the error, message which is the denominator type capture in role Rational:

m: my class MuskRat2 is Rat is FatRat does Rational[Int, Int] {}; say MuskRat2.new(1, 2).perl;
rakudo-moar e09f2ecc4: OUTPUT: «Cannot resolve caller infix:<==>(DeT, Int); none of these signatures match:␤    ($?)␤    (\a, \b)␤    (Real \a, Real \b)␤    (Int:D \a, Int:D \b)␤    (int $a, int $b)␤    (Num:D \a, Num:D \b --> Bool)␤    (num $a, num $b --> Bool)␤    …»
@zoffixznet

This comment has been minimized.

Show comment
Hide comment
@zoffixznet

zoffixznet May 16, 2018

Contributor

Another example:

Zoffix | m: constant MidRat = do { my $mr := Rat.HOW.new_type: :name<MidRat>; $mr.^add_parent: class :: does Rational[UInt, UInt] {}; $mr.^add_parent: Rat;  $mr.^compose; $mr }; dd MidRat.new(1, 2)
-- | --
00:35 | camelia | rakudo-moar 5ce24929f: OUTPUT: «Type check failed in binding to parameter '<anon>'; expected Any but got DeT (?)␤  in block <unit> at <tmp> line 1␤␤»
Contributor

zoffixznet commented May 16, 2018

Another example:

Zoffix | m: constant MidRat = do { my $mr := Rat.HOW.new_type: :name<MidRat>; $mr.^add_parent: class :: does Rational[UInt, UInt] {}; $mr.^add_parent: Rat;  $mr.^compose; $mr }; dd MidRat.new(1, 2)
-- | --
00:35 | camelia | rakudo-moar 5ce24929f: OUTPUT: «Type check failed in binding to parameter '<anon>'; expected Any but got DeT (?)␤  in block <unit> at <tmp> line 1␤␤»

@zoffixznet zoffixznet self-assigned this May 16, 2018

@zoffixznet zoffixznet removed the CaR Grant label Jul 28, 2018

@zoffixznet zoffixznet removed their assignment Jul 28, 2018

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