Skip to content

Commit

Permalink
Some invalid tests are actually supported by Leon/GenC!
Browse files Browse the repository at this point in the history
  • Loading branch information
mantognini committed Sep 21, 2016
1 parent 7f06782 commit 0f1e15a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import leon.annotation.extern
import leon.lang._

object BadInheritance2 {
object Inheritance7 {

abstract class Base {
def get: Int // Defining abstract method is not supported
def get: Int // Defining abstract method IS supported
}

case class Derived1(x: Int) extends Base {
Expand All @@ -17,8 +17,11 @@ object BadInheritance2 {
override def get: Int = 1
}

def test1 = Derived1(42).get // == 0
def test2 = Derived2(58).get - 1 // == 0

def _main() = {
0
test1 + test2
} ensuring { _ == 0 }

@extern
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import leon.annotation.extern
import leon.lang._

object BadInheritance1 {
object Inheritance8 {

abstract class Base {
def get: Int = 1
Expand All @@ -12,11 +12,14 @@ object BadInheritance1 {
case class Derived1(x: Int) extends Base

case class Derived2(x: Int) extends Base {
override def get: Int = 0 // Overriding a method is not supported
override def get: Int = 0 // Overriding a method IS supported
}

def test1 = Derived1(42).get - 1 // == 0
def test2 = Derived2(58).get // == 0

def _main() = {
0
test1 + test2
} ensuring { _ == 0 }

@extern
Expand Down

0 comments on commit 0f1e15a

Please sign in to comment.