Skip to content

Should have GIN error rather than gwt compiler error in package-private+generics corner case #188

Description

@GoogleCodeExporter
This is the specific example that bit us.  There may be a more general case to 
be found.

The visibility modifiers (or lack thereof) on A and B are important.

---

package x;

public class A<T> {
  A() {}
}

---

package y;

class B {}

---

package y;

class C {
  C(A<B> someParam) {}
}

---

The above code will yield a GWT compiler error on the ginjector fragment for 
package y saying that A's constructor isn't visible.  This is a bit confusing 
since generally you can inject another package's public object that only has a 
package private constructor.  If you look at the generated fragment for package 
y, you'll see that it tries to call A's constructor.

If you make B a public class things compile fine.  Presumably gin puts the 
construction of A<B> in package x's fragment.

In this case it would be helpful for gin to report that it's impossible for it 
to create a ginjector rather than generating uncompilable code.

Original issue reported on code.google.com by boppenh...@google.com on 2 May 2013 at 2:34

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions