Skip to content

Commit fbde042

Browse files
committed
Test type t cannot be accessed by expanded tlm
1 parent 278bbee commit fbde042

File tree

4 files changed

+18
-14
lines changed

4 files changed

+18
-14
lines changed

.gitignore

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,18 @@
88
*.cmxs
99
*.cmxa
1010
*.merlin
11-
12-
# ocamlbuild working directory
13-
_build/
14-
15-
# ocamlbuild targets
1611
*.byte
1712
*.native
1813

19-
# oasis generated files
20-
setup.data
21-
setup.log
14+
# dune working directory
15+
_build/
16+
17+
# dune .install files
18+
*.install
2219

2320
# vim files
2421
*.swp
2522
*.swo
2623

27-
# .err files generated by cram
28-
*.err
29-
30-
# .install files generated by jbuilder
31-
*.install
32-
3324
# generated by tests
3425
test/cases/dune

example_tlms/test_example/test_parser/parser.mly

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ literal:
2222
| "module" -> [%expr Std.unique () ]
2323
| "typed_fn" -> [%expr fun (a : new_type) -> a * a ]
2424
| "badly_typed_fn" -> [%expr fun (a : fake_type) -> a * a ]
25+
| "type_t_fn" -> [%expr fun (a : t) -> a * a ]
2526
| "$( 2 )" ->
2627
[%expr [%e Relit.ProtoExpr.spliced
2728
(Relit.Segment.mk (2, 4)) [%type: string ]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
open Regex_example;
2+
open Test_example;
3+
4+
open Test_example.Test_notation;
5+
let square = $absurd_int_arrow_int `(type_t_fn)`;
6+
let () = print_int(square(5));

test/test.ml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ let%expect_test "module_in_dependencies" =
2222
compile_and_run ~name:"module_in_dependencies";
2323
[%expect{| 42 |}]
2424

25+
let%expect_test "type_t_not_in_dependencies" =
26+
compile_and_run ~name:"type_t_not_in_dependencies";
27+
[%expect{|
28+
File "test/cases/type_t_not_in_dependencies.re", line 5, characters 13-48:
29+
Error: Unbound type constructor t |}]
30+
2531
let%expect_test "type_not_in_dependencies" =
2632
compile_and_run ~name:"type_not_in_dependencies";
2733
[%expect{|

0 commit comments

Comments
 (0)