original.name="Template_Valid_36" whiley.compile.ignore=true WhileyCompiler.issue=977 ====== >>> main.whiley // This test is interesting because one cannot distinguish between // List and List by looking a that their values. Instead, // this test case forces the use of runtime type tags. type List is null | { List next } function isListInt(List|List l) -> (bool r): if l is List: return true else: return false public export method test(): List li1 = null List li2 = { next: li1 } List li3 = { next: li2 } List lb1 = null List lb2 = { next: lb1 } List lb3 = { next: lb2 } // test negative cases assume !isListInt(lb1) assume !isListInt(lb2) assume !isListInt(lb3) // test positive cases assume isListInt(li1) assume isListInt(li2) assume isListInt(li3) ---