From 88974e1849991a5c90746cc5f78dd40fe211a604 Mon Sep 17 00:00:00 2001 From: pierre Date: Tue, 6 Jun 2000 20:08:05 +0000 Subject: [PATCH] new file --- tests/webtbs/tbug976.pp | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 tests/webtbs/tbug976.pp diff --git a/tests/webtbs/tbug976.pp b/tests/webtbs/tbug976.pp new file mode 100644 index 0000000000..107bd76f0f --- /dev/null +++ b/tests/webtbs/tbug976.pp @@ -0,0 +1,41 @@ +{ Source provided for Free Pascal Bug Report 976 } +{ Submitted by } +{ e-mail: } +Program Test_Me; + +type PDouble = ^Double; +var A, B: PDouble; + x: Double; + +Operator + (x: Double; A: PDouble) B: Double; + + begin + B := x + A^; + end; + +{ This was wrong because B value is not initialized !! +Operator + (x: Single; A: PDouble) B: PDouble; + + begin + B^ := x + A^; + end; } + +begin +new (A); +new (B); +x := 0.5; +A^ := x; + +{--- Addition "Double + Double": OK} +B^ := x + A^; +writeln (B^:4:2); +if B^<>1.0 then + Halt(1); +{---Identical error messages for addition "PDouble + Double" and "Double + PDouble"} +{---in spite of overloaded + operator} +// B := A + x; +B^ := x + A; +writeln (B^:4:2); +if B^<>1.0 then + Halt(1); +end. \ No newline at end of file