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

unsigned native ints not applied in class attributes #6184

Closed
p6rt opened this issue Apr 8, 2017 · 6 comments
Closed

unsigned native ints not applied in class attributes #6184

p6rt opened this issue Apr 8, 2017 · 6 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Apr 8, 2017

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

Searchable as RT131122$

@p6rt
Copy link
Author

p6rt commented Apr 8, 2017

From @dwarring

Consider

class C {
  has uint8 $.ff;
}
my $c = C.new(ff => 255);
say $c.perl;
say $c.ff;

class C2 is repr('CStruct') {
  has uint8 $.ff is rw;
}

my $c2 = C2.new;
$c2.ff = 200;
say $c2.ff;

Produces

C.new(ff => -1)
-1
-56

Both classes produce signed results, for the 'ff' attribute, declared as uint8.

david@​X346​:~$ perl6 -v
This is Rakudo version 2017.03-174-gd793e21 built on MoarVM version
2017.03-98-g9653dc6
implementing Perl 6.c.

@p6rt
Copy link
Author

p6rt commented Apr 8, 2017

From @AlexDaniel

Hm. There are several tickets like this.

Possibly related tickets​:
#RT 124088
#RT 127144
#RT 127210
#RT 124294
#RT 130267

Should we link them all together?

On 2017-04-07 19​:02​:23, david.warring wrote​:

Consider

class C {
has uint8 $.ff;
}
my $c = C.new(ff => 255);
say $c.perl;
say $c.ff;

class C2 is repr('CStruct') {
has uint8 $.ff is rw;
}

my $c2 = C2.new;
$c2.ff = 200;
say $c2.ff;

Produces

C.new(ff => -1)
-1
-56

Both classes produce signed results, for the 'ff' attribute, declared
as uint8.

david@​X346​:~$ perl6 -v
This is Rakudo version 2017.03-174-gd793e21 built on MoarVM version
2017.03-98-g9653dc6
implementing Perl 6.c.

@p6rt
Copy link
Author

p6rt commented Apr 8, 2017

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

@p6rt
Copy link
Author

p6rt commented Apr 8, 2017

From @dwarring

+1 Look related.

On Fri, 07 Apr 2017 19​:19​:19 -0700, alex.jakimenko@​gmail.com wrote​:

Hm. There are several tickets like this.

Possibly related tickets​:
#RT 124088
#RT 127144
#RT 127210
#RT 124294
#RT 130267

Should we link them all together?

On 2017-04-07 19​:02​:23, david.warring wrote​:

Consider

class C {
has uint8 $.ff;
}
my $c = C.new(ff => 255);
say $c.perl;
say $c.ff;

class C2 is repr('CStruct') {
has uint8 $.ff is rw;
}

my $c2 = C2.new;
$c2.ff = 200;
say $c2.ff;

Produces

C.new(ff => -1)
-1
-56

Both classes produce signed results, for the 'ff' attribute, declared
as uint8.

david@​X346​:~$ perl6 -v
This is Rakudo version 2017.03-174-gd793e21 built on MoarVM version
2017.03-98-g9653dc6
implementing Perl 6.c.

@p6rt
Copy link
Author

p6rt commented Apr 9, 2017

From @dwarring

I've added some tests to S12-attributes/native.t, based on these test cases.

On Fri, 07 Apr 2017 19​:31​:22 -0700, david.warring wrote​:

+1 Look related.

On Fri, 07 Apr 2017 19​:19​:19 -0700, alex.jakimenko@​gmail.com wrote​:

Hm. There are several tickets like this.

Possibly related tickets​:
#RT 124088
#RT 127144
#RT 127210
#RT 124294
#RT 130267

Should we link them all together?

On 2017-04-07 19​:02​:23, david.warring wrote​:

Consider

class C {
has uint8 $.ff;
}
my $c = C.new(ff => 255);
say $c.perl;
say $c.ff;

class C2 is repr('CStruct') {
has uint8 $.ff is rw;
}

my $c2 = C2.new;
$c2.ff = 200;
say $c2.ff;

Produces

C.new(ff => -1)
-1
-56

Both classes produce signed results, for the 'ff' attribute, declared
as uint8.

david@​X346​:~$ perl6 -v
This is Rakudo version 2017.03-174-gd793e21 built on MoarVM version
2017.03-98-g9653dc6
implementing Perl 6.c.

@p6rt p6rt added the Bug 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
Labels
Projects
None yet
Development

No branches or pull requests

2 participants