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

Composing Rational results in stripped function attributes #5506

Open
p6rt opened this issue Aug 1, 2016 · 1 comment
Open

Composing Rational results in stripped function attributes #5506

p6rt opened this issue Aug 1, 2016 · 1 comment

Comments

@p6rt
Copy link

p6rt commented Aug 1, 2016

Migrated from rt.perl.org#128794 (status was 'new')

Searchable as RT128794$

@p6rt
Copy link
Author

p6rt commented Aug 1, 2016

From @ajs

Example code​:

$ perl6 -e 'class NotComposed { has &.func = ~*; }; class IsRat does
Rational[Int,Int] { has &.func = ~* }; class IsReal does Real { has &.func
= ~* }; say "In NotComposed, func={NotComposed.new.func.perl}"; say "In
IsRat, func={IsRat.new.func.perl}"; say "In IsReal,
func={IsReal.new.func.perl}"'
In NotComposed, func={ ... }
In IsRat, func=Callable
In IsReal, func={ ... }

Expected all three lines of output to indicate the same value.

I suspect the Rational.new method's nqp​::create call is doing something
unfriendly at​:

https://github.com/rakudo/rakudo/blob/1ab1fb6f18c3a82dfdcd4e989dcbd5b3a43da940/src/core/Rational.pm#L19

Version and platform info​:

$ perl6 -v
This is Rakudo version 2016.07.1-34-ge5c909c built on MoarVM version
2016.07-3-gc01472d
implementing Perl 6.c.

$ uname -a
Linux hostname 4.4.0-31-generic #​50-Ubuntu SMP Wed Jul 13 00​:07​:12 UTC 2016
x86_64 x86_64 x86_64 GNU/Linux

--
Aaron Sherman, M.​:
P​: 617-440-4332 Google Talk, Email and Google Plus​: ajs@​ajs.com
Toolsmith, developer, gamer and life-long student.

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