Home
   News
   About the project
   Language
   Compiler download
   Test suite
   Blog on the programming model
   Zonnon @ OCP Forum
   Collection of examples

TEST: 050308T06-X

category

status

Compilation and execution results for Windows (first) and Mono (second)
PASSED Compiler: 1.2.8.0
Date, time: 2010.08.06, 18:06
Compilation: ERROR
Execution: NOT RUN
(16, 12) Illegal operand types 'real{64}' and 'cardinal{7}' for 'div' operator
(23, 2) Types 'procedure(var integer{32},integer{32})' and 'void' are not assignment compatible
PASSED Compiler: 1.2.8.0
Date, time: 2010.08.06, 22:22
Compilation: ERROR
Execution: NOT RUN
(16, 12) Illegal operand types 'real{64}' and 'cardinal{7}' for 'div' operator
(23, 2) Types 'procedure(var integer{32},integer{32})' and 'void' are not assignment compatible
(0, 0) Assembly reference not resolved: System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.

code

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
 (**   
  * 5. Declarations.  
  * 5.3. Type declaration.  
  * 5.3.7. Procedure types.  
  *  
  * Negative test: wrong formal parameter type   
  * in the procedure Sum declaration.  
  *)  
 module Main;  
      type PT = procedure(var integerinteger);  
   
      (* The correct procedure declaration is:                        *)  
      (*                 procedure Sum(var j : integer; i : integer); *)  
      procedure Sum(var j : integer; i : real);  
      begin  
           j := j + i div 2;  
      end Sum;  
   
      var k : integer;  
           pt : PT;  
 begin  
      k  := 3;  
      pt := Sum; (* The assignment of incorrect declared procedure. *)  
      pt(k, 1);  
        
      halt(0);  
 end Main. 

information

  • PASSED - overall positive decision about the test
  • NOT PASSED - overall negative decision about the test
  • SUCCESS - compilation / execution successful
  • ERROR - compilation failed with normal syntax or semantic error
  • ABORT - compilation failed because of an internal compiler error
  • NOT RUN - the test was not / not supposed to be executed
  • FAIL - execution failed
Copyright © 2010 ETH Zurich, Switzerland