eclipse-archived/ceylon

backend error for functional parameter with parameter of same name

Closed this issue · 4 comments

The following code breaks the Java backend:

class Broken(shared void bar(String bar)) {}

The error is the following:

source\test\test.ceylon:-1: error: Ceylon backend error: cannot find symbol
  symbol:   method $call$(Bar)
  location: variable bar of type Bar

I have edited the issue title and description, since the bug has nothing to do with use-site variance or meta literals. The problem arises when a functional parameter of a class has a parameter with the same name (bar in the example above).

We need to qualify the reference to the field bar with this. in the public method bar().

Fixed.

@gavinking

I have edited the issue title and description, since the bug has nothing to do with use-site variance or meta literals.

It's probably a different error than the one I originally found, then. Because:

  1. in my actual program, the parameter's parameter has a different name from the parameter itself
  2. exchanging the meta literal for a declaration meta literal fixed the problem
  3. I've noticed now that the error message in my program is actually different than the one I reported

I suppose I should investigate a little further and try to report the error I originally found.