bugKawa - Bugs: bug #37456, colon notation and calling a...

 
 

bug #37456: colon notation and calling a static method though an instance

Submitted by:  None
Submitted on:  Fri 28 Sep 2012 02:50:37 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: Feature RequestStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 28 Sep 2012 02:50:37 PM UTC, original submission:

Generally speaking, (instance:method-name argument ...) gives the
same result as (*:method-name instance argument ...), but
it is not necessarily true.

One of the exceptional cases is the case where the instance is
an instance of java.lang.Class, as described in the Kawa document.

I have found another exceptional case. Given a Java Class Foo:

public class Foo {
public Foo() {}
public static Object foo(Object obj) {
return obj;
}
}

(define bar (Foo))(bar:foo "abc") causes error:

gnu.mapping.WrongArguments: call to 'Foo.foo(java.lang.Object)' has too
many arguments (2; must be 1)

while (*:foo bar "abc") makes a good result.

I don't think calling a static method though an instance is not a
good practice, but it is sometimes used. Automatically rewriting
(*:x y ...) into (y:x ...) is dangerous.

I would like Kawa to support colon notation for calling a static method though an instance.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

No Changes Have Been Made to This Item

Back to the top


Powered by Savane 3.1-cleanup