Newer
Older
zweic / tests / 4 / term-call.zwei
@ajaggi ajaggi on 26 Dec 2005 581 bytes Added some test cases
  1. // Call
  2.  
  3. class foo {
  4. Int y;
  5. }
  6.  
  7. class bar {
  8. Int h;
  9. }
  10.  
  11. class bof extends bar {}
  12.  
  13. class baz {
  14. Int x;
  15. Null works(Int a, bar c) {}
  16. Null foo() {
  17. bof b = new bof(1);
  18. foo h = new foo(1);
  19. baz z = new baz(1);
  20. k.foo(); // 1/4 failure of clauses 1 and 2 (nonexistent ident)
  21. h.gneuh(); // 2/4 failure of clause 3 (nonexistent method)
  22. z.works(1); // 3/4 failure of clause 3 (wrong number of arguments)
  23. z.works(1, h); // 4/4 failure of clause 4 (parameter not subtype of bof)
  24. z.works(2, b); // success
  25. }
  26. }
  27.  
  28. 1