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

Pinpointed error message regression #6340

Closed
scabug opened this issue Sep 8, 2012 · 7 comments
Closed

Pinpointed error message regression #6340

scabug opened this issue Sep 8, 2012 · 7 comments

Comments

@scabug
Copy link

scabug commented Sep 8, 2012

In scala 2.9, a single error message is given for the following piece of code. In 2.10, since at least M1, it gives 15 error messages. This has to be what has been wreaking havoc on all the error output. Apparently the entire import is ignored if it contains a single unknown identifier.

object Test {
  import scala.collection.mutable.{
    Bippy, ArrayBuffer, ArrayBuilder, ArraySeq, ArrayStack, BitSet, DoubleLinkedList,
    HashMap, HashSet, History, LinkedList, ListBuffer, Publisher, Queue,
    Stack, StringBuilder, WrappedArray
  }
  val ab1 = new ArrayBuffer[String]
  // ArrayBuilder
  val abu1 = ArrayBuilder.make[Long]
  val abu2 = ArrayBuilder.make[Float]
  // ArraySeq
  val aq1 = ArraySeq(1, 2, 3)
  // ArrayStack
  val as1 = new ArrayStack[Int]
  // BitSet
  val bs1 = new BitSet()
  // DoubleLinkedList
  val dl1 = new DoubleLinkedList[Int](2, null)
  // HashMap
  val hm1 = new HashMap[String, Int]
  // HashSet
  val hs1 = new HashSet[String]
  val h1 = new History[String, Int]
  // ListBuffer
  val lb1 = new ListBuffer[String]
  // Queue
  val q1 = new Queue[Int]
  // Stack
  val s1 = new Stack[Int]
  // StringBuilder
  val sb1 = new StringBuilder
  // WrappedArray
  val wa1 = WrappedArray.make(Array(1, 2, 3))
}
% scalac29 -d /tmp a.scala 
a.scala:2: error: Bippy is not a member of scala.collection.mutable
  import scala.collection.mutable.{
         ^
one error found

% m1scalac -d /tmp a.scala 
a.scala:2: error: object Bippy is not a member of package scala.collection.mutable
  import scala.collection.mutable.{
         ^
a.scala:7: error: not found: type ArrayBuffer
  val ab1 = new ArrayBuffer[String]
                ^
a.scala:9: error: not found: value ArrayBuilder
  val abu1 = ArrayBuilder.make[Long]
             ^
a.scala:10: error: not found: value ArrayBuilder
  val abu2 = ArrayBuilder.make[Float]
             ^
a.scala:12: error: not found: value ArraySeq
  val aq1 = ArraySeq(1, 2, 3)
            ^
a.scala:14: error: not found: type ArrayStack
  val as1 = new ArrayStack[Int]
                ^
a.scala:16: error: not found: type BitSet
  val bs1 = new BitSet()
                ^
a.scala:18: error: not found: type DoubleLinkedList
  val dl1 = new DoubleLinkedList[Int](2, null)
                ^
a.scala:20: error: not found: type HashMap
  val hm1 = new HashMap[String, Int]
                ^
a.scala:22: error: not found: type HashSet
  val hs1 = new HashSet[String]
                ^
a.scala:23: error: not found: type History
  val h1 = new History[String, Int]
               ^
a.scala:25: error: not found: type ListBuffer
  val lb1 = new ListBuffer[String]
                ^
a.scala:27: error: not found: type Queue
  val q1 = new Queue[Int]
               ^
a.scala:29: error: not found: type Stack
  val s1 = new Stack[Int]
               ^
a.scala:33: error: not found: value WrappedArray
  val wa1 = WrappedArray.make(Array(1, 2, 3))
            ^
15 errors found
@scabug
Copy link
Author

scabug commented Sep 8, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6340?orig=1
Reporter: @paulp
Affected Versions: 2.10.0-M1, 2.10.0
Other Milestones: 2.10.0

@scabug
Copy link
Author

scabug commented Sep 8, 2012

@retronym said:
Perhaps relevant: scala/scala@ea78793c

Although, the regression appeared earlier: The earliest of my (woefully incomplete) catalog of 2.10.x builds, 20111022, shows the same error.

@scabug
Copy link
Author

scabug commented Sep 8, 2012

@retronym said:
Is the fix this easy: https://github.com/retronym/scala/compare/ticket/6340

@scabug
Copy link
Author

scabug commented Sep 8, 2012

@paulp said:
I came up with "typer.infer.setError(expr)" (instead of tree) at the same spot. It doesn't help that I still have no idea how it's supposed to work.

@scabug
Copy link
Author

scabug commented Sep 8, 2012

@paulp said:
Oh, and also "def base = expr.tpe" instead of val.

@scabug
Copy link
Author

scabug commented Sep 8, 2012

@paulp said:
scala/scala#1272

@scabug
Copy link
Author

scabug commented Sep 18, 2012

@gkossakowski said:
Fixed in scala/scala#1272

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants