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 ArithError4
0 / ()
end ArithError4
object ArithError5
- ()
end ArithError5
object ComparisonError
1 <= true
end ComparisonError
object ConcatError
1 ++ ""
end ConcatError
object ConstructorError
abstract class Foo
case class Bar(i: Int(32)) extends Foo
Bar(true)
end ConstructorError
object ConstructorError
abstract class Foo
case class Bar(i: Int(32)) extends Foo
case class Baz(i: Int(32), t: Foo) extends Foo
Baz(1, Baz(1, 2))
end ConstructorError
object ConstructorError
abstract class Foo
case class Bar(b2: Foo2) extends Foo
abstract class Foo2
case class Bar2(i: Int(32)) extends Foo2
Bar(Bar(Bar2(1)))
end ConstructorError
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