-
Notifications
You must be signed in to change notification settings - Fork 21
-explaintypes got too verbose #6123
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
Comments
Imported From: https://issues.scala-lang.org/browse/SI-6123?orig=1
|
@retronym said: |
@Blaisorblade said (edited on Jul 22, 2012 11:05:30 PM UTC): Normal output (Scala 2.9.1/.2): empty, as it's supposed to be. In particular, -explaintypes should never produce additional output on correct programs. $ scalac -explaintypes src/main/scala/ivm/expressiontree/ImplicitBugReport.scala
$ With the new release: $ ~/opt/scala-2.10.0-M5/bin/scalac -explaintypes src/main/scala/ivm/expressiontree/ImplicitBugReport.scala
Nothing <: ivm.expressiontree.ImplicitBugReport.Exp[Int]?
true
ivm.expressiontree.ImplicitBugReport.Exp[Int] <: ivm.expressiontree.ImplicitBugReport.Exp[T]?
false
Nothing <: ivm.expressiontree.ImplicitBugReport.Exp[Int]?
true
ivm.expressiontree.ImplicitBugReport.Exp[Int] <: ivm.expressiontree.ImplicitBugReport.Exp[T]?
ivm.expressiontree.ImplicitBugReport.type = ivm.expressiontree.ImplicitBugReport.type?
true
false
Unit <: ivm.expressiontree.ImplicitBugReport.CanBuildExp[Int,?]?
false
Nothing <: ivm.expressiontree.ImplicitBugReport.Exp[Int]?
true
ivm.expressiontree.ImplicitBugReport.Exp[Int] <: ivm.expressiontree.ImplicitBugReport.Exp[T]?
false
Nothing <: ivm.expressiontree.ImplicitBugReport.Exp[Int]?
true
ivm.expressiontree.ImplicitBugReport.Exp[Int] <: ivm.expressiontree.ImplicitBugReport.Exp[T]?
ivm.expressiontree.ImplicitBugReport.type = ivm.expressiontree.ImplicitBugReport.type?
true
false
Unit <: ivm.expressiontree.ImplicitBugReport.CanBuildExp[Int,?]?
false I believe that you can take any sufficiently wide codebase of yours, activate -explaintypes and see tons of such warnings arise out of nothing. I had the same problem porting https://github.com/Blaisorblade/BAT to 2.10, even though the code base does not use advanced Scala features as much as mine (as far as I know). |
@retronym said: |
@Blaisorblade said: scala.reflect.macros.Context <: scala.reflect.macros.Context?
true
c.universe.Expr[Any] <: c.universe.Expr[Any]?
true
c.universe.Expr[String] <: c.universe.Expr[String]?
true
scala.reflect.macros.Context <: scala.reflect.macros.Context?
true
c.universe.Expr[Any] <: c.universe.Expr[Any]?
true
c.universe.Expr[Unit] <: c.universe.Expr[Unit]?
true
scala.reflect.macros.Context <: scala.reflect.macros.Context?
true
c.universe.Expr[String] <: c.universe.Expr[String]?
true
c.universe.Expr[Any]* <: c.universe.Expr[Any]*?
true
c.universe.Expr[Unit] <: c.universe.Expr[Unit]?
true
scala.reflect.macros.Context <: scala.reflect.macros.Context?
true
c.universe.Expr[Any] <: c.universe.Expr[Any]?
true
c.universe.Expr[Any] <: c.universe.Expr[Any]?
true
scala.reflect.macros.Context <: scala.reflect.macros.Context?
true
c.universe.Expr[Any] <: c.universe.Expr[Any]?
true
c.universe.Expr[Any] <: c.universe.Expr[Any]?
true
scala.reflect.macros.Context <: scala.reflect.macros.Context?
true
c.universe.Expr[Any] <: c.universe.Expr[Any]?
true
c.universe.Expr[Any] <: c.universe.Expr[Any]?
true I could try minimizing it if really needed. |
@Blaisorblade said: |
@Blaisorblade said: |
@adriaanm said: |
@Blaisorblade said (edited on Jan 20, 2013 4:38:48 PM UTC): The problems are calls to
Pull request for the first part coming up soon. The first problem is in c800d1fec5241ed8c29e5af30465856f9b583246, in particular in + def NotWithinBounds(tree: Tree, prefix: String, targs: List[Type],
+ tparams: List[Symbol], kindErrors: List[String]) = {
+ if (settings.explaintypes.value) {
+ val bounds = tparams map (tp => tp.info.instantiateTypeParams(tparams, targs).bounds)
+ (targs, bounds).zipped foreach ((targ, bound) => explainTypes(bound.lo, targ))
+ (targs, bounds).zipped foreach ((targ, bound) => explainTypes(targ, bound.hi))
+ ()
+ }
+
+ issueNormalTypeError(tree,
+ prefix + "type arguments " + targs.mkString("[", ",", "]") +
+ " do not conform to " + tparams.head.owner + "'s type parameter bounds " +
+ (tparams map (_.defString)).mkString("[", ",", "]"))
+ } |
@Blaisorblade said (edited on Jan 20, 2013 11:30:53 PM UTC): |
@Blaisorblade said: |
@hubertp said: I am happy to review your stuff so just include me in the PR. |
@Blaisorblade said:
On the most important tests, see But I'll also update some neg test. |
@Blaisorblade said (edited on Jan 21, 2013 11:49:13 PM UTC): |
@adriaanm said: |
@Blaisorblade said: |
@Blaisorblade said: |
@retronym said: |
With 2.10.0-M5 -explaintypes got much more verbose, compared to (for instance) Scala 2.9.x -- it produces extra output even when compilation does not fail.
While this might be done to help debugging, I don't think this is justified even for an intermediate release - debugging stuff should have separate options.
This problem was already briefly discussed on scala-language; Daniel Sobral suggested a bug report.
https://groups.google.com/forum/?fromgroups#!topic/scala-language/XG5SsELdwAg
The text was updated successfully, but these errors were encountered: