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

Improve the exceptions that are thrown by Kotlin-Guiced #4

Merged
merged 3 commits into from Nov 7, 2018

Conversation

JLLeitschuh
Copy link
Owner

@JLLeitschuh JLLeitschuh commented Nov 5, 2018

Before:

com.google.inject.CreationException: Unable to create injector, see the following errors:

1) A binding to org.jlleitschuh.guice.Interface was already configured at org.jlleitschuh.guice.BinderScope.bind(BinderScope.kt:43).
  at org.jlleitschuh.guice.BinderScope.bind(BinderScope.kt:43)

Now:

com.google.inject.CreationException: Unable to create injector, see the following errors:

1) A binding to org.jlleitschuh.guice.Interface was already configured at org.jlleitschuh.guice.ModuleTest$module binding exceptions provide meaningful exceptions$module$1.invoke(ModuleTest.kt:100).
  at org.jlleitschuh.guice.ModuleTest$module binding exceptions provide meaningful exceptions$module$1.invoke(ModuleTest.kt:104)

kotlinOptions {
jvmTarget = "1.8"

freeCompilerArgs += "-Xprogressive"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be -progressive.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I knew it would be good to have you on this PR. Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-Xprogressive still works, though. The original 1.2.51 (IIRC) release notes said to use -Xprogressive but the Kotlin docs say -progressive. The compiler actually looks for -Xprogressive and will print out a warning to you saying to use -progressive instead.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We aren't at Kotlin 1.3 for this project yet so this can't be done yet, unfortunately.

@JLLeitschuh JLLeitschuh merged commit c63788c into master Nov 7, 2018
@JLLeitschuh JLLeitschuh deleted the binder-exception-improvements branch November 7, 2018 03:06
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.

None yet

2 participants