- // zweic - test program for method typing
- // M. Ganguin, J. Ruffin 2005
- class foo {}
- class bar extends foo {}
- class baz extends bar {}
- // Method
- class MethodTest {
- bar overrideTest(bar a, bar b) { return new bar() } // success of clause 3
- baz overrideTest(bar a, bar b) { // 3/5 failure of clauses 3 and 4 (return type not subtype of baz)
- return new baz()
- }
- }
- 0