Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • shchen/cs320
  • raveendr/cs320
  • mwojnaro/cs320
3 results
Show changes
Showing
with 96 additions and 0 deletions
object ConstructorError
abstract class Foo
case class Bar(i: Int(32)) extends Foo
abstract class Foo2
case class Bar2(i: Int(32)) extends Foo2
val x: Foo = Bar2(42);
x
end ConstructorError
object Equality
abstract class Foo
case class Bar(i: Int(32)) extends Foo
1 == Bar(2)
end Equality
object ErrorError
error(1)
end ErrorError
object FunctionCall
def foo(i: Int(32)): Boolean = { i < 0 }
foo(true)
end FunctionCall
object FunctionCall
def foo(i: Int(32)): Boolean = { i < 0 }
val x: Int(32) = foo(1); x
end FunctionCall
object FunctionCall
def foo(i: Int(32), b: Boolean): Boolean = { i < 0 }
foo(true, 1)
end FunctionCall
object IfAndErrorWrong
val x: Int(32) = if (true) { error("") } else { "" };
x
end IfAndErrorWrong
object IfError
if (42) { () } else { () }
end IfError
object IfError
if (true) { () } else { false }
end IfError
object IfError
val x: Int(32) = if (false) { "" } else { "" };
x
end IfError
object LetError1
def test(): Int(32) = {
val x: Int(32) = 1;
false
}
end LetError1
object LetError2
def test(): Int(32) = {
val x: Int(32) = false;
2
}
end LetError2
object LogicalError
1 || 2
end LogicalError
object LogicalError
() && true
end LogicalError
object LogicalError
!()
end LogicalError
object MatchError
1 match { case true => () }
end MatchError
object MatchError
val x: Int(32) = 1 match { case 2 => "" }; x
end MatchError
object MatchError
1 match {
case 1 => ()
case 2 => ""
}
end MatchError
object MatchError
abstract class Foo
case class Bar(i: Int(32)) extends Foo
Bar(1) match {
case true => ()
}
end MatchError
object MatchError
abstract class Foo
case class Bar(i: Int(32)) extends Foo
Bar(1) match {
case Bar(true) => ()
}
end MatchError