File tree Expand file tree Collapse file tree 3 files changed +76
-0
lines changed
ocaml/testsuite/tests/typing-layouts Expand file tree Collapse file tree 3 files changed +76
-0
lines changed Original file line number Diff line number Diff line change
1
+
2
+ Line 6, characters 44-47:
3
+ 6 | let unboxed_integers_must_have_a_modifier = #42
4
+ ^^^
5
+ Error: Syntax error: literal modifier expected.
6
+
Original file line number Diff line number Diff line change
1
+ (* TEST
2
+ flags = "-extension layouts_alpha"
3
+ * toplevel
4
+ *)
5
+
6
+ let unboxed_integers_must_have_a_modifier = #42
Original file line number Diff line number Diff line change
1
+ (* TEST
2
+ flags = "-extension layouts_alpha"
3
+ * expect
4
+ *)
5
+
6
+ let e = #2.718281828459045
7
+ [%% expect{|
8
+ val e : float = 2.71828182845904509
9
+ |}]
10
+
11
+ let negative_one_half = - #0.5
12
+ [%% expect{|
13
+ val negative_one_half : float = - 0.5
14
+ |}]
15
+
16
+ let positive_one_dot = + #1.
17
+ [%% expect{|
18
+ val positive_one_dot : float = 1.
19
+ |}]
20
+
21
+ let one_billion = #1e9
22
+ [%% expect{|
23
+ val one_billion : float = 1000000000.
24
+ |}]
25
+
26
+ let zero = #0n
27
+ [%% expect{|
28
+ val zero : nativeint = 0n
29
+ |}]
30
+
31
+ let positive_one = + #1l
32
+ [%% expect{|
33
+ val positive_one : int32 = 1l
34
+ |}]
35
+
36
+ let negative_one = - #1L
37
+ [%% expect{|
38
+ val negative_one : int64 = - 1L
39
+ |}]
40
+
41
+ let two_fifty_five_in_hex = #0xFFn
42
+ [%% expect{|
43
+ val two_fifty_five_in_hex : nativeint = 255n
44
+ |}]
45
+
46
+ let twenty_five_in_octal = #0o31l
47
+ [%% expect{|
48
+ val twenty_five_in_octal : int32 = 25l
49
+ |}]
50
+
51
+ let forty_two_in_binary = #0b101010L
52
+ [%% expect{|
53
+ val forty_two_in_binary : int64 = 42L
54
+ |}]
55
+
56
+ let one_twenty_seven_point_two_five_in_floating_hex = #0x7f .4
57
+ [%% expect{|
58
+ val one_twenty_seven_point_two_five_in_floating_hex : float = 127.25
59
+ |}]
60
+
61
+ let five_point_three_seven_five_in_floating_hexponent = #0xa .cp-1
62
+ [%% expect{|
63
+ val five_point_three_seven_five_in_floating_hexponent : float = 5.375
64
+ |}]
You can’t perform that action at this time.
0 commit comments