pike.git
/
src
/
testsuite.in
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/testsuite.in:2919:
inherit a; class c { int d (string x, string y) { return x==y; } } } ]]) test_compile([[Stdio.File foo=Stdio.FILE();]])
+
dnl variant
test_any([[
-
+
class A {
+
variant string a() { return "A:a()"; }
+
variant string a(string s) { return sprintf("A:a(%q)", s); }
+
};
+
class B {
+
inherit A;
+
variant string a(int i) { return local::a() + ":" + local::a((string)i) + ":" + ::a((string)i); }
+
variant string a(string s) { return sprintf("B:a(%q)", s); }
+
};
+
class C {
+
inherit B;
+
string a() { return "C:a()"; }
+
variant string a(string s) { return ::a(sizeof(s)) + "|" + ::a(s) + "|" + a(); }
+
};
+
return C()->a("foo");
+
]], "A:a():B:a(\"3\"):A:a(\"3\")|B:a(\"foo\")|C:a()")
+
+
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";