michaelwiles / google-gin

Automatically exported from code.google.com/p/google-gin
Apache License 2.0
0 stars 0 forks source link

Gwt gin does not handle injection of class implementing vistor Vistor that is internal to an enum #34

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create an enum (Foo) with an inner Visitor<T> interface

2. set up a binding from visitor to an implementing class
bind(new TypeLeteral<Foo.Vistor<Bar>>).to(BarVistor.class);

where the BarVistor implements Foo.Vistor<Bar>

3. watch gin blow up with 
      Computing all possible rebind results for SCRUBBED MyInjector'
         Rebinding SCRUBBED MyInjector

            Invoking <generate-with
class='com.google.gwt.inject.rebind.GinjectorGenerator'/>
               [ERROR] Generator
'com.google.gwt.inject.rebind.GinjectorGenerator' threw threw an exception

while rebinding 'SCRUBBED MyInjector'
java.lang.IllegalArgumentException: No owner type for enclosed interface
Foo$Visitor

        at
com.google.inject.internal.base.Preconditions.checkArgument(Preconditions.java:1
11)
        at
com.google.inject.internal.MoreTypes$ParameterizedTypeImpl.<init>(MoreTypes.java
:471)
        at

com.google.inject.util.Types.newParameterizedTypeWithOwner(Types.java:60)
        at com.google.inject.util.Types.newParameterizedType(Types.java:49)
        at
com.google.gwt.inject.rebind.util.KeyUtil.gwtTypeToJavaType(KeyUtil.java:261)

        at com.google.gwt.inject.rebind.util.KeyUtil.getKey(KeyUtil.java:108)
        at com.google.gwt.inject.rebind.util.KeyUtil.getKey(KeyUtil.java:70)
        at
com.google.gwt.inject.rebind.binding.CreatorBinding.addParamTypes(CreatorBinding
.java:108)

        at
com.google.gwt.inject.rebind.binding.CallConstructorBinding.setConstructor(CallC
onstructorBinding.java:45)
        at
com.google.gwt.inject.rebind.BindingsProcessor.createImplicitBindingForClass(Bin
dingsProcessor.java:402)

        at
com.google.gwt.inject.rebind.BindingsProcessor.createImplicitBinding(BindingsPro
cessor.java:384)
        at
com.google.gwt.inject.rebind.BindingsProcessor.createImplicitBindingsForUnresolv
ed(BindingsProcessor.java:187)

        at
com.google.gwt.inject.rebind.BindingsProcessor.process(BindingsProcessor.java:17
9)
        at
com.google.gwt.inject.rebind.GinjectorGeneratorImpl.generate(GinjectorGeneratorI
mpl.java:76)
        at

com.google.gwt.inject.rebind.GinjectorGenerator.generate(GinjectorGenerator.java
:47)
        at
com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:49)
        at
com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.tryRebind(StandardRebindO
racle.java:113)

        at
com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOrac
le.java:62)
        at
com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:1
72)
        at

com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:1
61)
        at
com.google.gwt.dev.Precompile$DistillerRebindPermutationOracle.getAllPossibleReb
indAnswers(Precompile.java:243)
        at

com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.doFindAdditionalTypesUsingRebinds
(WebModeCompilerFrontEnd.java:177)
        at
com.google.gwt.dev.jdt.AbstractCompiler$CompilerImpl.process(AbstractCompiler.ja
va:151)

        at
com.google.gwt.thirdparty.org.eclipse.jdt.internal.compiler.Compiler.compile(Com
piler.java:444)
        at
com.google.gwt.dev.jdt.AbstractCompiler$CompilerImpl.compile(AbstractCompiler.ja
va:85)
        at

com.google.gwt.dev.jdt.AbstractCompiler$CompilerImpl.compile(AbstractCompiler.ja
va:181)
        at
com.google.gwt.dev.jdt.AbstractCompiler$CompilerImpl.access$400(AbstractCompiler
.java:71)
        at
com.google.gwt.dev.jdt.AbstractCompiler.compile(AbstractCompiler.java:473)

        at
com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.getCompilationUnitDeclarations(We
bModeCompilerFrontEnd.java:121)
        at
com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile(JavaToJavaScriptCompi
ler.java:325)

        at com.google.gwt.dev.Precompile.precompile(Precompile.java:341)
        at com.google.gwt.dev.Precompile.run(Precompile.java:444)
        at com.google.gwt.dev.Precompile$1.run(Precompile.java:291)
        atcom.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:84)
        at
com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.
java:78)
        at com.google.gwt.dev.Precompile.main(Precompile.java:298)

Original issue reported on code.google.com by martinl...@gmail.com on 1 Apr 2009 at 1:12

GoogleCodeExporter commented 9 years ago
Patch submitted for review: http://codereview.appspot.com/32094

Original comment by aragos on 1 Apr 2009 at 7:03

GoogleCodeExporter commented 9 years ago

Original comment by aragos on 21 May 2009 at 12:58