Skip to content

Commit

Permalink
Merge pull request #5204 from vrurg/fix-version-class-serialization
Browse files Browse the repository at this point in the history
Fix serialization issues with Version
  • Loading branch information
vrurg committed Feb 12, 2023
2 parents dfcd577 + 9e4fa28 commit bc9bd9b
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions src/core.c/Version.pm6
@@ -1,51 +1,50 @@
# class Version {
# has $!parts;
# has int $!plus;
# has int $!whatever;
# has str $!string;
# }
my class Version {
# class Version {
# has $!parts;
# has int $!plus;
# has int $!whatever;
# has str $!string;
# }

class Version {

constant $v = do {
my constant $v = do {
my $version := nqp::create(Version);
nqp::bindattr( $version,Version,'$!parts', nqp::list());
nqp::bindattr_s($version,Version,'$!string',"");
$version
}
constant $vw = do {
my constant $vw = do {
my $version := nqp::create(Version);
nqp::bindattr( $version,Version,'$!parts', nqp::list(*));
nqp::bindattr_i($version,Version,'$!plus', -1);
nqp::bindattr_i($version,Version,'$!whatever',1);
nqp::bindattr_s($version,Version,'$!string', "*");
$version
}
constant $v6 = do {
my constant $v6 = do {
my $version := nqp::create(Version);
nqp::bindattr( $version,Version,'$!parts', nqp::list(6));
nqp::bindattr_s($version,Version,'$!string',"6");
$version
}
constant $v6c = do {
my constant $v6c = do {
my $version := nqp::create(Version);
nqp::bindattr( $version,Version,'$!parts', nqp::list(6,"c"));
nqp::bindattr_s($version,Version,'$!string',"6.c");
$version
}
constant $v6d = do {
my constant $v6d = do {
my $version := nqp::create(Version);
nqp::bindattr( $version,Version,'$!parts', nqp::list(6,"d"));
nqp::bindattr_s($version,Version,'$!string',"6.d");
$version
}
constant $v6e = do {
my constant $v6e = do {
my $version := nqp::create(Version);
nqp::bindattr( $version,Version,'$!parts', nqp::list(6,"e","PREVIEW"));
nqp::bindattr_s($version,Version,'$!string',"6.e.PREVIEW");
$version
}
constant $vplus = do {
my constant $vplus = do {
my $version := nqp::create(Version);
nqp::bindattr( $version,Version,'$!parts', nqp::list);
nqp::bindattr_i($version,Version,'$!plus', 1);
Expand Down

0 comments on commit bc9bd9b

Please sign in to comment.