pike.git / src / testsuite.in

version» Context lines:

pike.git/src/testsuite.in:3112:      test_compile_warning([[    class A {    string a(int i) { return "A"+i+"A"; }    variant string a(int i, int|void j) { return "B"+i+"C"+j+"C"+"B"; }    };    return A()->a(1) + A()->a(2, 3);   ]])      test_any([[ +  class A { string a(){ return "A"; } }; +  class B { int a(){ return 17; } }; +  class C { +  string c(A a) { return "C" + a->a() + "C"; } +  variant string c(B b) { return "CB" + b->a() + "BC"; } +  }; +  A a = A(); +  B b = B(); +  C c = C(); +  return c->c(a) + c->c(b); + ]], "CACCB17BC") +  + test_compile_warning([[ +  // Bug 7812. +  class A { string a(){ return "A"; } }; +  class B { int a(){ return 17; } }; +  class C { +  string c(array(A) a) { return "C" + (a->a() * "C") + "C"; } +  variant string c(array(B) b) { return "CB" + `+(0, @b->a()) + "BC"; } +  }; +  A a = A(); +  B b = B(); +  C c = C(); +  return c->c(({a,a})) + c->c(({b,b})); + ]]) +  + test_any([[    // Test symbol lookup for inherit in multi-pass.    // LysLysKOM 16472935    // An old pike will attempt to lookup X in the innermost X    // during the second pass and thus fail with a compilation error.    class X {    constant foo = "outer";    class X {    constant foo = "middle";    class X {    constant foo = "inner";