Skip to content

Conversation

@davidmarne
Copy link
Contributor

@davidmarne davidmarne commented Oct 5, 2017

Action dipatcher's whose payloads were thunks, repatches or any other type that had generics that contained Built/Builder pairs from the same library would result in the Builder being dynamic because the AST could not resolve the Builder. The resolution would fail because when build resolves the structure the Builder class had not yet been generated.

This checks if the generics bound params include Built, Builder and if so, renames the type argument proceeding the Built as the Built's type name + 'Builder'

This this will generate correctly:

typedef TypedefWithBuildGenerics<V extends Build<V, B>, V extends Builder<V, B>>()

...

ActionDispatcher<TypedefWithBuildGenerics<Foo, FooBuilder>> fooDispatcher;

but this would not:

typedef TypedefWithoutBoundGenerics<V, B>()
...

ActionDispatcher<TypedefWithoutBoundGenerics<Foo, FooBuilder>> fooDispatcher;

@codecov-io
Copy link

codecov-io commented Oct 5, 2017

Codecov Report

Merging #34 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #34   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           6      6           
  Lines          78     78           
=====================================
  Hits           78     78

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bb9c1d2...4470d5b. Read the comment docs.

@davidmarne
Copy link
Contributor Author

@zoechi this fixes the problem where the Builder in Thunk's generics get generated as dynamic

@davidmarne davidmarne merged commit 2101010 into master Oct 13, 2017
@davidmarne davidmarne deleted the fix_thunk_and_repatch_generic_generation branch October 13, 2017 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants