Skip to content

Fix different compilation warnings #253

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

Merged
merged 3 commits into from
Apr 28, 2019
Merged

Conversation

gslowikowski
Copy link
Member

From time to time it's good to fix the warnings, because they sometimes turn into errors in next Scala versions.

There are two remaining kinds of warnings, which cannot be fixed simply:

1.
[warn] .../scalac-scoverage-plugin/src/main/scala/scoverage/coverage.scala:39:80: object DeprecatedDoubleOrdering in object Ordering is deprecated (since 2.13.0): There are multiple ways to order Doubles (Ordering.Double.TotalOrdering, Ordering.Double.IeeeOrdering). Specify one by using a local import, assigning an implicit val, or passing it explicitly. See the documentation for details.
[warn]   def risks(limit: Int) = classes.toSeq.sortBy(_.statementCount).reverse.sortBy(_.statementCoverage).take(limit)
[warn]                                                                                ^

There are no Ordering.Double.TotalOrdering and Ordering.Double.IeeeOrdering classes in previous Scala versions.

2.
[warn] .../scalac-scoverage-plugin/src/test/scala/scoverage/ScoverageCompiler.scala:71:97: class Reporter in package reporters is deprecated (since 2.13.0): Use reflect.internal.Reporter
[warn] class ScoverageCompiler(settings: scala.tools.nsc.Settings, reporter: scala.tools.nsc.reporters.Reporter)

'reflect.internal.Reporter' class cannot be used because 'scoverage.ScoverageCompiler' class extends 'scala.tools.nsc.Global' class, and it requires 'scala.tools.nsc.reporters.Reporter' as a constructor parameter.
…cation warnings

All warning are macro-related and reported when Scala version is >= 2.11. There were three kinds:

1.
scoverage_snippet6266375223143133247.scala:5: warning: macro defs must have explicitly specified return types (inference of Unit from macro impl's c.Expr[Unit] is deprecated and is going to stop working in 2.12)
  def test = macro testImpl
      ^

2.
scoverage_snippet6266375223143133247.scala:6: warning: type Context in package macros is deprecated: Use blackbox.Context or whitebox.Context instead
  def testImpl(c: Context): c.Expr[Unit] = {
                  ^

3.
scoverage_snippet6689360552943102771.scala:6: warning: method literal in trait ExprUtils is deprecated: Use quasiquotes instead
                def poly[T: c.WeakTypeTag] = c.literal(c.weakTypeOf[T].toString)
                                               ^
@gslowikowski gslowikowski merged commit 9cf6357 into master Apr 28, 2019
@gslowikowski gslowikowski deleted the fix-compilation-warnings branch May 21, 2019 19:49
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.

1 participant