Newer
Older
zweic / tests / four / method00-3.zwei
@glproj03 glproj03 on 28 Dec 2005 396 bytes wicked cool test file added: script.sh
// 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
    
    foo overrideTest(bar a, bar b) { // 3/5 failure of clauses 3 and 4 (return type not subtype of bar)
        return new bar()
    }
}

0