| 1 |
# - : unit = () |
| 2 |
# - : int = 1 |
| 3 |
- : int = 2 |
| 4 |
# - : int = 3 |
| 5 |
- : unit = () |
| 6 |
# - : int = 5 |
| 7 |
- : unit = () |
| 8 |
# * - : int = 7 |
| 9 |
# * Line 2, characters 6-9: |
| 10 |
2 | 750;; (*) comment-start warning after semicolon must be displayed once |
| 11 |
^^^ |
| 12 |
Warning 1 [comment-start]: this (* is the start of a comment. |
| 13 |
Hint: Did you forget spaces when writing the infix operator ( * )? |
| 14 |
|
| 15 |
- : int = 750 |
| 16 |
# Line 2, characters 9-11: |
| 17 |
2 | 8;; let 9;; 10;; (* Syntax error in second phrase. *) |
| 18 |
^^ |
| 19 |
Error: Syntax error |
| 20 |
# - : int = 11 |
| 21 |
Line 2, characters 16-20: |
| 22 |
2 | 11;; let x = 12+true;; 13;; (* Type error in second phrase. *) |
| 23 |
^^^^ |
| 24 |
Error: The constructor true has type bool |
| 25 |
but an expression was expected of type int |
| 26 |
# Line 2, characters 0-22: |
| 27 |
2 | match 14 with 15 -> ();; 16;; 17;; (* Warning + run-time error in 1st phrase. *) |
| 28 |
^^^^^^^^^^^^^^^^^^^^^^ |
| 29 |
Warning 8 [partial-match]: this pattern-matching is not exhaustive. |
| 30 |
Here is an example of a case that is not matched: 0 |
| 31 |
|
| 32 |
Exception: Match_failure ("//toplevel//", 2, 0). |
| 33 |
- : int = 16 |
| 34 |
- : int = 17 |
| 35 |
# - : int = 18 |
| 36 |
Line 2, characters 5-27: |
| 37 |
2 | 18;; match 19 with 20 -> ();; 21;; (* Warning + run-time error in 2nd phrase. *) |
| 38 |
^^^^^^^^^^^^^^^^^^^^^^ |
| 39 |
Warning 8 [partial-match]: this pattern-matching is not exhaustive. |
| 40 |
Here is an example of a case that is not matched: 0 |
| 41 |
|
| 42 |
Exception: Match_failure ("//toplevel//", 2, 5). |
| 43 |
- : int = 21 |
| 44 |
# Line 2, characters 6-8: |
| 45 |
2 | let f 22 = ();; let f 23 = ();; let f 24 = ();; (* Several warnings. *) |
| 46 |
^^ |
| 47 |
Warning 8 [partial-match]: this pattern-matching is not exhaustive. |
| 48 |
Here is an example of a case that is not matched: 0 |
| 49 |
|
| 50 |
val f : int -> unit = <fun> |
| 51 |
Line 2, characters 22-24: |
| 52 |
2 | let f 22 = ();; let f 23 = ();; let f 24 = ();; (* Several warnings. *) |
| 53 |
^^ |
| 54 |
Warning 8 [partial-match]: this pattern-matching is not exhaustive. |
| 55 |
Here is an example of a case that is not matched: 0 |
| 56 |
|
| 57 |
val f : int -> unit = <fun> |
| 58 |
Line 2, characters 38-40: |
| 59 |
2 | let f 22 = ();; let f 23 = ();; let f 24 = ();; (* Several warnings. *) |
| 60 |
^^ |
| 61 |
Warning 8 [partial-match]: this pattern-matching is not exhaustive. |
| 62 |
Here is an example of a case that is not matched: 0 |
| 63 |
|
| 64 |
val f : int -> unit = <fun> |
| 65 |
# * * * |