Skip to content

Commit 9e43be8

Browse files
committed
Add example of record instantiation and alias -- not working yet.
1 parent 5d92829 commit 9e43be8

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

analysis/tests/src/Hover.res

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,4 +171,16 @@ module TypeSubstitutionRecords = {
171171

172172
// x2.content.
173173
// ^com
174+
175+
type foo2<'b> = foo<'b>
176+
type foobar2 = foo2<bar>
177+
178+
let y1: foo2<bar> = {content: {age: 42}, zzz: ""}
179+
let y2: foobar2 = {content: {age: 42}, zzz: ""}
180+
181+
// y1.content.
182+
// ^com
183+
184+
// y2.content.
185+
// ^com
174186
}

analysis/tests/src/expected/Hover.res.txt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ Hover src/Hover.res 165:22
112112

113113
Complete src/Hover.res 168:16
114114
posCursor:[168:16] posNoWhite:[168:15] Found expr:[168:5->168:16]
115-
Pexp_field [168:5->168:15] _:[173:0->168:16]
115+
Pexp_field [168:5->168:15] _:[174:2->168:16]
116116
Completable: Cpath Value[x1].content.""
117117
[{
118118
"label": "age",
@@ -124,7 +124,7 @@ Completable: Cpath Value[x1].content.""
124124

125125
Complete src/Hover.res 171:16
126126
posCursor:[171:16] posNoWhite:[171:15] Found expr:[171:5->171:16]
127-
Pexp_field [171:5->171:15] _:[173:0->171:16]
127+
Pexp_field [171:5->171:15] _:[174:2->171:16]
128128
Completable: Cpath Value[x2].content.""
129129
[{
130130
"label": "age",
@@ -134,3 +134,15 @@ Completable: Cpath Value[x2].content.""
134134
"documentation": null
135135
}]
136136

137+
Complete src/Hover.res 180:16
138+
posCursor:[180:16] posNoWhite:[180:15] Found expr:[180:5->180:16]
139+
Pexp_field [180:5->180:15] _:[185:0->180:16]
140+
Completable: Cpath Value[y1].content.""
141+
[]
142+
143+
Complete src/Hover.res 183:16
144+
posCursor:[183:16] posNoWhite:[183:15] Found expr:[183:5->183:16]
145+
Pexp_field [183:5->183:15] _:[185:0->183:16]
146+
Completable: Cpath Value[y2].content.""
147+
[]
148+

0 commit comments

Comments
 (0)