Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible bug with explicit @Duck procedure #178

Open
dwtj opened this issue Mar 6, 2017 · 3 comments
Open

Possible bug with explicit @Duck procedure #178

dwtj opened this issue Mar 6, 2017 · 3 comments
Labels

Comments

@dwtj
Copy link
Collaborator

dwtj commented Mar 6, 2017

(I haven't really looked at this carefully, but I wanted to put this here before I forget.)

The following example appeared to make the annotation processor stop responding (i.e. in Eclipse, sources were no longer being generated).

package types;

public interface Tree {
	int numChildren();
	// ...
}
package ex;

import org.paninij.lang.Capsule;
import org.paninij.lang.Duck;

import types.Tree;

@Capsule
class ServerCore {
	@Duck Tree getTree() {
		Tree t = null;
		// ...
		return t;
	}
}

However, the issue goes away once the explicit @Duck annotation is removed.

As usual, it will probably be easier to debug this by doing so on the CLI rather than in the IDE.

@dwtj dwtj added the bug label Mar 6, 2017
@dwtj
Copy link
Collaborator Author

dwtj commented Mar 6, 2017

Once @Duck is removed, it looks like the generated source is marking getTree() as @Block. Hmmm...

@dwtj
Copy link
Collaborator Author

dwtj commented Mar 6, 2017

But then, if you make Tree be a class rather than an interface, the generated source marks getTree() as @Duck.

I bet that this is a problem with the procedure annotation inference code. Or maybe two problems... Here are my guesses:

  • The IDE locks up because an exception is being thrown and crashing the annotation processor.
  • The annotation inference code doesn't correctly handle the case that a return type is an interface type.

@dwtj
Copy link
Collaborator Author

dwtj commented Mar 20, 2017

Related? #139

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant