Skip to content

Commit

Permalink
!add_implicit_self on a Signature should be able to take a type, whic…
Browse files Browse the repository at this point in the history
…h will become the invocant's type in the signature.
  • Loading branch information
jnthn committed Apr 8, 2009
1 parent 241ae0d commit 776152d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/classes/Signature.pir
Expand Up @@ -162,6 +162,11 @@ Ensures that if there is no explicit invocant, we add one.
=cut
.sub '!add_implicit_self' :method
.param pmc type :optional
unless null type goto have_type
type = get_hll_global 'Object'
have_type:
.local pmc params
params = self.'params'()
$I0 = elements params
Expand All @@ -176,9 +181,7 @@ Ensures that if there is no explicit invocant, we add one.
$P0['name'] = 'self'
$P0['invocant'] = 1
$P0['multi_invocant'] = 1
# XXX Need to get type of class/role/grammar method is in.
$P1 = get_hll_global 'Object'
$P0['nom_type'] = $P1
$P0['nom_type'] = type
unshift params, $P0
.end
Expand Down

0 comments on commit 776152d

Please sign in to comment.