File tree Expand file tree Collapse file tree 1 file changed +71
-0
lines changed
tests/test-dirs/type-enclosing Expand file tree Collapse file tree 1 file changed +71
-0
lines changed Original file line number Diff line number Diff line change 1+ $ cat > main. ml << EOF
2+ > module type T = sig
3+ > type ' a t
4+ > end
5+ >
6+ > module N = struct
7+ > module M (T : T) = struct
8+ > type t = int T.t
9+ > end
10+ > end
11+ >
12+ > module F = struct
13+ > module T = struct type ' a t end
14+ > end
15+ >
16+ > type u = N. M(F. T). t
17+ > EOF
18+
19+ This should return the type of `t` (line 7 )
20+ $ $ MERLIN single type-enclosing -position 15 : 18 -verbosity 1 \
21+ > -filename main. ml < main. ml
22+ {
23+ " class" : " return" ,
24+ " value" : [
25+ {
26+ " start" : {
27+ " line" : 15 ,
28+ " col" : 9
29+ },
30+ " end" : {
31+ " line" : 15 ,
32+ " col" : 19
33+ },
34+ " type" : " int F.T.t" ,
35+ " tail" : " no"
36+ },
37+ {
38+ " start" : {
39+ " line" : 15 ,
40+ " col" : 0
41+ },
42+ " end" : {
43+ " line" : 15 ,
44+ " col" : 19
45+ },
46+ " type" : " type u = int F.T.t" ,
47+ " tail" : " no"
48+ }
49+ ],
50+ " notifications" : []
51+ }
52+
53+ Type of T (line 12 )
54+ $ $ MERLIN single type-enclosing -position 15 : 15 \
55+ > -filename main. ml < main. ml | jq ' .value[0].type'
56+ " sig type 'a t end"
57+
58+ Type of F (line 11 )
59+ $ $ MERLIN single type-enclosing -position 15 : 13 \
60+ > -filename main. ml < main. ml | jq ' .value[0].type'
61+ " sig module T : sig type 'a t end end"
62+
63+ Type of M (line 6 )
64+ $ $ MERLIN single type-enclosing -position 15 : 11 \
65+ > -filename main. ml < main. ml | jq ' .value[0].type'
66+ " functor (T : T) -> sig type t = int T.t end"
67+
68+ Type of N (line 5 )
69+ $ $ MERLIN single type-enclosing -position 15 : 9 \
70+ > -filename main. ml < main. ml | jq ' .value[0].type'
71+ " sig module M : functor (T : T) -> sig type t = int T.t end end"
You can’t perform that action at this time.
0 commit comments