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

uint behaves like signed int in CUnion #5022

Closed
p6rt opened this issue Jan 8, 2016 · 4 comments
Closed

uint behaves like signed int in CUnion #5022

p6rt opened this issue Jan 8, 2016 · 4 comments

Comments

@p6rt
Copy link

p6rt commented Jan 8, 2016

Migrated from rt.perl.org#127210 (status was 'open')

Searchable as RT127210$

@p6rt
Copy link
Author

p6rt commented Jan 8, 2016

From @Juerd

Got​:

  > my $c = Overlap.new(u32 => 1234567);
  Overlap.new(u32 => 1234567, u16 => -10617, u8 => -121)

Expected​:

  Overlap.new(u32 => 1234567, u16 => 54919, u8 => 135);

Tests​:

  class Overlap is repr('CUnion') {
  has uint32 $.u32;
  has uint16 $.u16;
  has uint8 $.u8;
  }
  my $overlap = Overlap.new(u32 => 1234567);
  is $overlap.u16, 54919, "uint16 in union is unsigned";
  is $overlap.u8, 135, "uint8 in union is unsigned";

--
Met vriendelijke groet, // Kind regards, // Korajn salutojn,

Juerd Waalboer <juerd@​tnx.nl>
TNX

@p6rt
Copy link
Author

p6rt commented Jan 8, 2016

From @lizmat

On 08 Jan 2016, at 03​:20, Juerd Waalboer (via RT) <perl6-bugs-followup@​perl.org> wrote​:

# New Ticket Created by Juerd Waalboer
# Please include the string​: [perl #​127210]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=127210 >

Got​:

my $c = Overlap.new(u32 => 1234567);
Overlap.new(u32 => 1234567, u16 => -10617, u8 => -121)

Expected​:

Overlap.new(u32 => 1234567, u16 => 54919, u8 => 135);

Tests​:

class Overlap is repr('CUnion') {
has uint32 $.u32;
has uint16 $.u16;
has uint8 $.u8;
}
my $overlap = Overlap.new(u32 => 1234567);
is $overlap.u16, 54919, "uint16 in union is unsigned";
is $overlap.u8, 135, "uint8 in union is unsigned";

Added tests with d8cf465

@p6rt
Copy link
Author

p6rt commented Jan 8, 2016

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

@p6rt p6rt added the NativeCall label Jan 5, 2020
@niner
Copy link

niner commented Feb 2, 2022

Fixed as of rakudo/rakudo@8bba2ae

@niner niner closed this as completed Feb 2, 2022
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

2 participants