#1640: Method names that start with '@' are not recognized.
-----------------------+----------------------------------------------------
Reporter: shockwave | Type: bug
Status: new | Priority: major
Milestone: | Component: imcc
Version: 2.3.0 | Severity: high
Keywords: | Lang:
Patch: | Platform:
-----------------------+----------------------------------------------------
Unless class methods cannot start with '@' (or just be named '@'), there
is a bug in Parrot regarding that.
Regular subroutines (not methods) *can* be named '@'.
If this is the expected behavior (hopefully not), it should be marked as
such in the docs.
# The following fails. Change to '*', and it succeeds.
.namespace ['Test']
.sub '%' :method
say 'help'
.end
.sub 'main' :main
$P0 = newclass 'Test'
$P1 = new 'Test'
$P1.'%'()
.end
# Error message: Method '@' not found for invocant of class 'Test'
My personal usecase of that is: In my language (as in C++), operators can
be overloaded, included @. Such operator would create a method named '@',
or a mangled version name something like '@m13_1', in PIR.
--
Ticket URL: <https://trac.parrot.org/parrot/ticket/1640>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets