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

Another variation on error message regression #5821

Closed
scabug opened this issue May 22, 2012 · 7 comments
Closed

Another variation on error message regression #5821

scabug opened this issue May 22, 2012 · 7 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented May 22, 2012

I'm losing an awful lot of time decoding torrents of spurious error messages. In this case only the inability to find NameTransformer is legitimate; as soon as I fixed that it compiled.

quick.lib:
[scalacfork] Compiling 2 files to /scala/trunk/build/quick/classes/library
[scalacfork] /scala/trunk/src/library/scala/util/Origins.scala:8: error: not found: object NameTransformer
[scalacfork] import NameTransformer._
[scalacfork]        ^
[scalacfork] /scala/trunk/src/library/scala/util/Origins.scala:108: error: type mismatch;
[scalacfork]  found   : xs.type (with underlying type OneLine.this.StackSlice)
[scalacfork]  required: ?{def eq(x$1: ? >: Null(null)): ?}
[scalacfork]  possible cause: missing arguments for method or constructor
[scalacfork] Note that implicit conversions are not applicable because they are ambiguous:
[scalacfork]  both method tuple2ToZippedOps in object Predef of type [T1, T2](x: (T1, T2))runtime.Tuple2Zipped.Ops[T1,T2]
[scalacfork]  and method tuple3ToZippedOps in object Predef of type [T1, T2, T3](x: (T1, T2, T3))runtime.Tuple3Zipped.Ops[T1,T2,T3]
[scalacfork]  are possible conversion functions from xs.type to ?{def eq(x$1: ? >: Null(null)): ?}
[scalacfork]     def newRep(xs: StackSlice): Rep     = if ((xs eq null) || (xs.length == 0)) null else xs(0)
[scalacfork]                                                ^
[scalacfork] /scala/trunk/src/library/scala/util/Origins.scala:108: error: value eq is not a member of OneLine.this.StackSlice
[scalacfork]     def newRep(xs: StackSlice): Rep     = if ((xs eq null) || (xs.length == 0)) null else xs(0)
[scalacfork]                                                   ^
[scalacfork] /scala/trunk/src/library/scala/util/Origins.scala:108: error: type mismatch;
[scalacfork]  found   : OneLine.this.StackSlice
[scalacfork]     (which expands to)  <error>
[scalacfork]  required: ?{def apply: ?}
[scalacfork] Note that implicit conversions are not applicable because they are ambiguous:
[scalacfork]  both method booleanArrayOps in object Predef of type (xs: Array[Boolean])scala.collection.mutable.ArrayOps.ofBoolean
[scalacfork]  and method byteArrayOps in object Predef of type (xs: Array[Byte])scala.collection.mutable.ArrayOps.ofByte
[scalacfork]  are possible conversion functions from OneLine.this.StackSlice to ?{def apply: ?}
[scalacfork]     def newRep(xs: StackSlice): Rep     = if ((xs eq null) || (xs.length == 0)) null else xs(0)
[scalacfork]                                                                                           ^
[scalacfork] /scala/trunk/src/library/scala/util/Origins.scala:108: error: OneLine.this.StackSlice does not take parameters
[scalacfork]     def newRep(xs: StackSlice): Rep     = if ((xs eq null) || (xs.length == 0)) null else xs(0)
[scalacfork]                                                                                             ^
[scalacfork] /scala/trunk/src/library/scala/util/Origins.scala:114: error: type mismatch;
[scalacfork]  found   : xs.type (with underlying type MultiLine.this.StackSlice)
[scalacfork]  required: ?{def take: ?}
[scalacfork]  possible cause: missing arguments for method or constructor
[scalacfork] Note that implicit conversions are not applicable because they are ambiguous:
[scalacfork]  both method booleanArrayOps in object Predef of type (xs: Array[Boolean])scala.collection.mutable.ArrayOps.ofBoolean
[scalacfork]  and method byteArrayOps in object Predef of type (xs: Array[Byte])scala.collection.mutable.ArrayOps.ofByte
[scalacfork]  are possible conversion functions from xs.type to ?{def take: ?}
[scalacfork]     def newRep(xs: StackSlice): Rep     = (xs take numLines).toList
[scalacfork]                                            ^
[scalacfork] /scala/trunk/src/library/scala/util/Origins.scala:115: error: type mismatch;
[scalacfork]  found   : rep.type (with underlying type MultiLine.this.Rep)
[scalacfork]  required: ?{def map(x$1: ? >: Any => String): ?}
[scalacfork]  possible cause: missing arguments for method or constructor
[scalacfork] Note that implicit conversions are not applicable because they are ambiguous:
[scalacfork]  both method booleanArrayOps in object Predef of type (xs: Array[Boolean])scala.collection.mutable.ArrayOps.ofBoolean
[scalacfork]  and method byteArrayOps in object Predef of type (xs: Array[Byte])scala.collection.mutable.ArrayOps.ofByte
[scalacfork]  are possible conversion functions from rep.type to ?{def map(x$1: ? >: Any => String): ?}
[scalacfork]     def repString(rep: Rep)             = rep.map("\n  " + _).mkString
[scalacfork]                                           ^
[scalacfork] /scala/trunk/src/library/scala/util/Origins.scala:115: error: value map is not a member of MultiLine.this.Rep
[scalacfork]     def repString(rep: Rep)             = rep.map("\n  " + _).mkString
[scalacfork]                                               ^
[scalacfork] 8 errors found

BUILD FAILED
/scala/trunk/build.xml:504: Compilation failed because of an internal compiler error; see the error output for details.

Total time: 7 seconds
@scabug
Copy link
Author

scabug commented May 22, 2012

Imported From: https://issues.scala-lang.org/browse/SI-5821?orig=1
Reporter: @paulp

@scabug
Copy link
Author

scabug commented May 23, 2012

@hubertp said:
Is your secret code somewhere available ? I couldn't find anything similar to this on github in any of the branches.

@scabug
Copy link
Author

scabug commented May 23, 2012

@paulp said:
My secret code is in the vault! I reconstructed the scenario for you here:

https://github.com/paulp/scala/tree/issue/5821

@scabug
Copy link
Author

scabug commented May 24, 2012

@hubertp said:
Actually, compared to 2.9.2 it isn't so bad because it reports 5 errors with this example. I will try to get it down at least to that number.

@scabug
Copy link
Author

scabug commented May 24, 2012

@hubertp said:
This is a really weird bug. Reduced (you have to have the type member Sth to trigger it):

import SthImportant._

class Bar

abstract class Foo {
  type Sth = Array[Bar]
}

class Foo2 extends Foo {
  def foo(xs: Sth): Bar = if ((xs eq null) || (xs.length == 0)) null else xs(0)
}

@scabug
Copy link
Author

scabug commented May 25, 2012

@hubertp said:
Fixed in ea78793c618968d8

@scabug scabug closed this as completed May 25, 2012
@scabug
Copy link
Author

scabug commented May 25, 2012

@paulp said:
Thanks a lot!

@scabug scabug added this to the 2.10.0-M3 milestone Apr 7, 2017
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