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

Rational doesn't preserve types of nu/de #1855

zoffixznet opened this issue May 22, 2018 · 0 comments


None yet
2 participants
Copy link

commented May 22, 2018

(filing as a reminder for myself to look at as part of the grant)

On master, it currently just boxes to Int:

<Zoffix__> m: class Foo does Rational[IntStr, IntStr] {}; say ( <1>, <2>).numerator.^name
<camelia> rakudo-moar 2f4b2f428: OUTPUT: «Int␤»

On car-grant-unreduce branch, it currently uses the right type, but it simply boxes the Int into it, so with stuff like IntStr we get a partially-uninitizalized object:

$ ./perl6 -e 'm: class Foo does Rational[IntStr, IntStr] {}; say ( <1>, <2>).numerator.^name'

2018.04.1 zoffix@VirtualBox~/R/rakudo (car-grant-unreduce)$ ./perl6 -e 'say (<1>/<2>).numerator.^name'                                                                                                                                                         
2018.04.1 zoffix@VirtualBox~/R/rakudo (car-grant-unreduce)$ ./perl6 -e 'say (<1>/<2>).numerator'                                                                                                                                                               
concatenate requires a concrete string, but got null
  in block <unit> at -e line 1

@zoffixznet zoffixznet self-assigned this May 22, 2018

zoffixznet added a commit that referenced this issue May 22, 2018

[CaR Grant] Add trial impl of single-arg
Potentially needed for fixing R#1855

Still playing around with the idea.

@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
You can’t perform that action at this time.