Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improve handling of <-> so any traits explicitly set in the signature…

… are not overridden with rw.
  • Loading branch information...
commit 2e70f2dc7eb31ba2214ee9261dc64a0a64f797ea 1 parent bb2cdb7
@jnthn jnthn authored
Showing with 6 additions and 2 deletions.
  1. +2 −0  src/classes/Signature.pir
  2. +4 −2 src/parser/actions.pm
View
2  src/classes/Signature.pir
@@ -162,6 +162,8 @@ Makes all parameters have readtype rw (used to implement e.g. <->).
it_loop:
unless it goto it_loop_end
param = shift it
+ $P0 = param['readtype']
+ unless null $P0 goto it_loop
param['readtype'] = 'rw'
goto it_loop
it_loop_end:
View
6 src/parser/actions.pm
@@ -1111,14 +1111,16 @@ method signature($/, $key) {
$sigparam.push($trait);
}
- my $readtype := trait_readtype( $var<traitlist> ) || 'readonly';
+ my $readtype := trait_readtype( $var<traitlist> );
if $readtype eq 'CONFLICT' {
$<parameter>[$i].panic(
"Can use only one of readonly, rw, and copy on "
~ $name ~ " parameter"
);
}
- $sigparam.push(PAST::Val.new(:value($readtype),:named('readtype')));
+ if $readtype {
+ $sigparam.push(PAST::Val.new(:value($readtype),:named('readtype')));
+ }
## if it's an invocant, flag it as such and make the var be a
## lexical that has self register bound to it
Please sign in to comment.
Something went wrong with that request. Please try again.