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

Adding -Xfatal-warnings #39

Closed
samuelgruetter opened this issue Oct 8, 2014 · 5 comments
Closed

Adding -Xfatal-warnings #39

samuelgruetter opened this issue Oct 8, 2014 · 5 comments

Comments

@samuelgruetter
Copy link
Collaborator

Warnings by the Scala compiler often reveal problems with the code, and there's the -Xfatal-warnings option which makes the build fail if there are warnings. Currently, there are no warnings in this project, so we could add the -Xfatal-warnings option without problems, and be sure that further PRs don't introduce any warnings.

I tried to add the option to build.sbt, but it only applies to the root project but not to the examples project. Apparently scalacOptions in ThisBuild means "really only this project without sub-projects". But that would mean that the other options also don't apply to the examples project, which would be bad... /cc @jmhofer @zsxwing

@headinthebox
Copy link
Contributor

Let's hope we don't have any warnings.

@samuelgruetter
Copy link
Collaborator Author

build.sbt is not set in stone ;-) So if at some point we get a false warning that we can't silence, we can just remove the -Xfatal-warnings option.

@zsxwing
Copy link
Member

zsxwing commented Oct 9, 2014

There are some warnings when compiling with Scala 2.11.

[warn] /Users/zsx/workspace-scala/RxScala/src/test/scala/rx/lang/scala/CompletenessTest.scala:268: method paramss in trait MethodSymbolApi is deprecated: Use `paramLists` instead
[warn]       val paramListStrs = for (paramList <- m.paramss) yield {
[warn]                                               ^
[warn] /Users/zsx/workspace-scala/RxScala/src/test/scala/rx/lang/scala/CompletenessTest.scala:281: method declarations in class TypeApi is deprecated: Use `decls` instead
[warn]     methodMembersToMethodStrings(tp.declarations.filter {
[warn]                                     ^
[warn] /Users/zsx/workspace-scala/RxScala/src/test/scala/rx/lang/scala/CompletenessTest.scala:296: method companionSymbol in trait SymbolApi is deprecated: Use `companion` instead, but beware of possible changes in behavior
[warn]       getPublicInstanceMethods(tp.typeSymbol.companionSymbol.typeSignature)
[warn]                                              ^
[warn] /Users/zsx/workspace-scala/RxScala/src/test/scala/rx/lang/scala/CompletenessTest.scala:319: method companionSymbol in trait SymbolApi is deprecated: Use `companion` instead, but beware of possible changes in behavior
[warn]                    typeOf[rx.Observable[_]].typeSymbol.companionSymbol.typeSignature)
[warn]                                                        ^
[warn] four warnings found

@jbripley
Copy link
Contributor

jbripley commented Oct 9, 2014

I tried to fix those in a CompletenessTest cleanup PR that I made, but the suggested method/property changes for the remaining deprecation warnings don't exist in 2.10.

@samuelgruetter
Copy link
Collaborator Author

So this means that there is no solution which emits no warnings and no errors both in 2.10 and 2.11. Which probably means that we better give up the idea of adding the -Xfatal-warnings option...

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

4 participants