Permalink
Browse files

Removing warnings (about JVM 1.5 & "match is not exhaustive").

  • Loading branch information...
1 parent 469615b commit ae86ff3766e0a4baf4eb487ecec2bb6404c47f12 @sergei-romanenko committed Oct 12, 2011
View
@@ -82,7 +82,7 @@
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
<args>
- <arg>-target:jvm-1.5</arg>
+ <arg>-target:jvm-1.6</arg>
</args>
</configuration>
</plugin>
@@ -4,7 +4,7 @@ package mrsc.pfp.charity
// a b c d == a (b(c(d)))
// {f, g} : X -> (Y x Z)
object CharityInterpreter {
- def eval(e: Expr): Expr = e match {
+ def eval(e: Expr): Expr = (e: @unchecked) match {
// id,
case FoldApp(fold, CtrApp(n, e1)) => {
// берем соответсвующую var-base, матчим с e1.
@@ -21,15 +21,15 @@ object Decomposition {
case class RedexGCallCtr(gcall: GCall, ctr: Ctr) extends Redex(gcall)
case class RedexGCallVar(gcall: GCall, vrb: Var) extends Redex(gcall)
- def decompose(t: Expr): Dec = t match {
+ def decompose(t: Expr): Dec = (t: @unchecked) match {
case l: Let => DecLet(l)
case v: Var => ObservableVar(v)
case c: Ctr => ObservableCtr(c)
case f: FCall => new ContextHole(RedexFCall(f))
case g: GCall => processGCall(g)
}
- private def processGCall(g: GCall): Context = g.args.head match {
+ private def processGCall(g: GCall): Context = (g.args.head: @unchecked) match {
case g1: GCall => new ContextGCall(g, processGCall(g1))
case f: FCall => new ContextGCall(g, new ContextHole(RedexFCall(f)))
case v: Var => new ContextHole(RedexGCallVar(g, v))
@@ -40,7 +40,7 @@ object Lifting {
}
// the only thing it does is collect definitions
- def lift(e: Expr): (Expr, List[Def]) = e match {
+ def lift(e: Expr): (Expr, List[Def]) = (e: @unchecked) match {
case v: Var =>
(v, Nil)
case Ctr(n, args) =>
@@ -88,7 +88,7 @@ object SyntaxNormalization {
def v(x: Int): Var = Var("v." + x)
def vn(x: Int): Name = "v." + x
- def fixBoundVars(e: Expr, m: ListMap[Name, Int]): Expr = e match {
+ def fixBoundVars(e: Expr, m: ListMap[Name, Int]): Expr = (e: @unchecked) match {
case Var(n) => m.get(n).map(v).getOrElse(n)
case Ctr(n, args) => Ctr(n, args map { fixBoundVars(_, m) })
case FCall(n, args) => FCall(n, args map { fixBoundVars(_, m) })
@@ -134,7 +134,7 @@ object SyntaxNormalization {
}
- def fixFs(e: Expr): Expr = e match {
+ def fixFs(e: Expr): Expr = (e: @unchecked) match {
case v: Var => v
case Ctr(n, args) => Ctr(n, args map fixFs)
case FCall(n, args) => FCall(fmap(n), args map fixFs)
@@ -66,7 +66,7 @@ object SLLSyntax {
case (Ctr(n1, args1), Ctr(n2, args2)) if n1 == n2 => walk1(args1 zip args2, s)
case (FCall(n1, args1), FCall(n2, args2)) if n1 == n2 => walk1(args1 zip args2, s)
case (GCall(n1, args1), GCall(n2, args2)) if n1 == n2 => walk1(args1 zip args2, s)
- case (Var(n), to) => s.get(n) match {
+ case (Var(n), to) => (s.get(n): @unchecked) match {
case Some(to1) if to1 == to => Some(s)
case Some(to1) if to1 != to => None
case None => Some(s + (n -> to))
@@ -84,7 +84,7 @@ trait SLLSemantics extends PFPSemantics[Expr] {
val program: Program
override def driveConf(conf: Expr): DriveStep[Expr] =
- decompose(conf) match {
+ (decompose(conf): @unchecked) match {
case ObservableVar(v) =>
StopDriveStep()

0 comments on commit ae86ff3

Please sign in to comment.