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

Binding @Spreads #206

Open
mcassiano opened this issue Jul 24, 2020 · 4 comments
Open

Binding @Spreads #206

mcassiano opened this issue Jul 24, 2020 · 4 comments

Comments

@mcassiano
Copy link
Member

mcassiano commented Jul 24, 2020

Should we be able to do something like:

interface Component {
  fun a(): A
}

@Spread
abstract fun bindComponent(component: Component): Component

And then local scope would be able so directly see A. Right now we fail because of a dependency cycle.

@mcassiano
Copy link
Member Author

mcassiano commented Jul 24, 2020

Adding a qualifier to the return type makes it work gracefully. I think this can be treated as a bug. I can send in a pull request if this is a wanted feature.

@andreasnomikos
Copy link

how are you going to treat the presence of Qualifiers in this case ?
This api will create an imbalance for methods tagged with @SPREAD.
currently all methods in @objects contribute the returned type+qualifier to the graph. with the proposed change
@SPREAD methods will be treated differently than other methods.

because this will be a breaking api change I don't think this PR will be advisable.

Adding the Qualifier to increase clarity is not a big overhead IMO.

@mcassiano
Copy link
Member Author

I wouldn't qualify types with @SPREAD, rather make Sinks/Sources not raise a cycle error in this case. I'm ok with not "fixing" this, but I think there's opportunity to at least document this case?

@andreasnomikos
Copy link

Better documentation sounds great.

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

No branches or pull requests

2 participants