diff options
author | Paul Phillips <paulp@improving.org> | 2012-09-28 06:55:49 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-09-28 07:19:01 -0700 |
commit | 886c4061222773d76f3ee3f4ff1469f9d4a48eaf (patch) | |
tree | 70b13842e325bafd48e5494c844078f35b02f5b7 /test/pending/pos | |
parent | 41f37bc428a309b9766f545da0179f270ea01d77 (diff) | |
parent | 57db28c55c3610f508b07940f7077cb73932418f (diff) | |
download | scala-886c4061222773d76f3ee3f4ff1469f9d4a48eaf.tar.gz scala-886c4061222773d76f3ee3f4ff1469f9d4a48eaf.tar.bz2 scala-886c4061222773d76f3ee3f4ff1469f9d4a48eaf.zip |
Merge branch '2.10.x' into 210-merge
* 2.10.x: (37 commits)
Added logic and tests for unchecked refinements.
Moved isNonRefinementClassType somewhere logical.
Moved two tests to less breaky locations.
Nailed down the "impossible match" logic.
Finish docs for string interpolation.
moves Context.ParseError outside the cake
revives macros.Infrastructure
moves Context.runtimeUniverse to TreeBuild.mkRuntimeUniverseRef
a more precise type for Context.mirror
gets rid of macros.Infrastructure
simplifies Context.Run and Context.CompilationUnit
exposes Position.source as SourceFile
removes extraneous stuff from macros.Infrastructure
merges macros.CapturedVariables into macros.Universe
merges macros.Exprs and macros.TypeTags into Context
removes front ends from scala-reflect.jar
PositionApi => Position
hides BuildUtils from Scaladoc
MirrorOf => Mirror
docs.pre-lib now checks for mods in reflect
...
Conflicts:
test/files/neg/t4302.check
test/files/neg/unchecked.check
test/files/neg/unchecked2.check
Diffstat (limited to 'test/pending/pos')
-rw-r--r-- | test/pending/pos/exhaust_2.scala | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/test/pending/pos/exhaust_2.scala b/test/pending/pos/exhaust_2.scala new file mode 100644 index 0000000000..4f4e47c43b --- /dev/null +++ b/test/pending/pos/exhaust_2.scala @@ -0,0 +1,54 @@ +object ExhaustivityWarnBugReportMinimal { + //sealed is needed for the warning + sealed trait FoundNode[T]/*presence of parameters is irrelevant*/ + // This also causes a warning: + // sealed abstract class FoundNode[T]/*presence of parameters is irrelevant*/ + case class FoundFilter[T](/*presence of parameters is irrelevant*/) extends FoundNode[T] + case class FoundTypeCase[T](/*presence of parameters is irrelevant*/) extends FoundNode[T] + val f: Some[_] = ??? + f match { + case x: Some[t] => //no warning + } + //With these variants, no warnings: + //val v: (Some[Int], FoundNode[_]) = (???, ???) + //val v: (Some[AnyRef], FoundNode[_]) = (???, ???) + //val v: (Some[String], FoundNode[_]) = (???, ???) + + val v: (Some[_], FoundNode[_]) = (???, ???) + //Warning here: + v match { + case (x: Some[t], _: FoundNode[_]) => + } + v match { + case (x: Some[t], _) => + } + + v match { + case (x: Some[_], _) => + } + case class Foo[T]() + + val vp: (Foo[_], FoundNode[_]) = (???, ???) + vp match { + case (x: Foo[_], _) => + } + + //No warning here: + v match { + case (Some(y), _) => + } + + v match { + case (x, _) => + } + + val v2: (Some[_], Int) = (???, ???) + v2 match { + case (x: Some[t], _) => + } + + val v3: (Option[_], FoundNode[_]) = (???, ???) + v match { + case (x: Option[_], _) => + } +} |