Ticket #1640 (closed bug: fixed)
Method names that start with '@' are not recognized.
Reported by: | shockwave | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | imcc | Version: | 2.3.0 |
Severity: | high | Keywords: | |
Cc: | Language: | ||
Patch status: | Platform: |
Description
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.