diff options
author | Paul Phillips <paulp@improving.org> | 2012-05-10 13:44:29 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-05-10 15:56:44 -0700 |
commit | 1bff5703d28a0232dc772769dd6017862114a4a2 (patch) | |
tree | 47847356c4daca5a4db1d76a0b29decb8d1f8bf8 /test/pending/pos/t4717.scala | |
parent | 63a53e339598be1c8ffcb6e30a01d84b473d64fa (diff) | |
download | scala-1bff5703d28a0232dc772769dd6017862114a4a2.tar.gz scala-1bff5703d28a0232dc772769dd6017862114a4a2.tar.bz2 scala-1bff5703d28a0232dc772769dd6017862114a4a2.zip |
More useful crash reports.
If you can't get your hands on something which crashes
scalac - I know, I know - you can try this ready-made crasher.
% cat test/pending/pos/t4717.scala
trait Bounds[@specialized A] {
// okay without `>: A`
def x[B >: A]: Unit = new Bounds[B] {
lazy val it = ??? // def or val okay
it
}
}
% scalac -d /tmp test/pending/pos/t4717.scala
error:
while compiling: test/pending/pos/t4717.scala
during phase: specialize
library version: version 2.10.0-20120510-134429-ce1d68ed19
compiler version: version 2.10.0-20120510-152646-ba4dfd1e63
reconstructed args: -d /tmp
last tree to typer: Select(This(trait Bounds$mcZ$sp), x$mcZ$sp)
symbol: method x$mcZ$sp in trait Bounds$mcZ$sp (flags: override <method> <specialized>)
symbol definition: override def x$mcZ$sp[B >: Boolean](): Unit
tpe: [B >: Boolean]()Unit
symbol owners: method x$mcZ$sp -> trait Bounds$mcZ$sp -> package <empty>
context owners: value it -> anonymous class $anon -> method x$mcZ$sp -> trait Bounds$mcZ$sp -> package <empty>
== Enclosing template or block ==
Block(
Assign(
$anon.this."it "
Apply( // def ???(): Nothing in object Predef, tree.tpe=Nothing
scala.this."Predef"."$qmark$qmark$qmark" // def ???(): Nothing in object Predef, tree.tpe=()Nothing
Nil
)
)
$anon.this."it " // lazy private[this] var it: Nothing, tree.tpe=Nothing
)
== Expanded type of tree ==
PolyType(
typeParams = List(TypeParam(B >: Boolean))
resultType = NullaryMethodType(
resultType = TypeRef(TypeSymbol(final class Unit extends AnyVal))
)
)
// And then the usual stack trace
Diffstat (limited to 'test/pending/pos/t4717.scala')
-rw-r--r-- | test/pending/pos/t4717.scala | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/pending/pos/t4717.scala b/test/pending/pos/t4717.scala index 43cf412bc6..7eaa3dd487 100644 --- a/test/pending/pos/t4717.scala +++ b/test/pending/pos/t4717.scala @@ -1,7 +1,7 @@ -trait Bug1[@specialized +A] extends TraversableOnce[A] { - def ++[B >: A](that: TraversableOnce[B]): Iterator[B] = new Iterator[B] { - lazy val it = that.toIterator - def hasNext = it.hasNext - def next = it.next +trait Bounds[@specialized A] { + // okay without `>: A` + def x[B >: A]: Unit = new Bounds[B] { + lazy val it = ??? // def or val okay + it } }
\ No newline at end of file |