Skip to content

Commit e220d26

Browse files
committed
Add an example of wrong reference with inner modules, .resi, and shadowing.
In the example, the reference to `DefinitionWithInterface.Inner.y` leads to `DefinitionWithInterface.y` instead. This seems to happen only when there is an interface file, and the outer module has the same value named `y` as the inner module. See #652
1 parent dd056e2 commit e220d26

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

Diff for: analysis/tests/src/Cross.res

+3
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ type defT2 = DefinitionWithInterface.t
3636

3737
// DefinitionWithInterface.a
3838
// ^com
39+
40+
let yy = DefinitionWithInterface.Inner.y
41+
// ^def

Diff for: analysis/tests/src/DefinitionWithInterface.res

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@ let y = 4
44
type t = int
55

66
let aabbcc = 3
7-
let _ = aabbcc
7+
let _ = aabbcc
8+
9+
module Inner = {
10+
let y = 100
11+
}

Diff for: analysis/tests/src/DefinitionWithInterface.resi

+4
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@ let y: int
22
// ^def
33

44
type t
5+
6+
module Inner: {
7+
let y: int
8+
}

Diff for: analysis/tests/src/expected/Cross.res.txt

+3
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,6 @@ Pexp_ident DefinitionWithInterface.a:[36:3->36:28]
9999
Completable: Cpath Value[DefinitionWithInterface, a]
100100
[]
101101

102+
Definition src/Cross.res 39:39
103+
{"uri": "DefinitionWithInterface.res", "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}}
104+

0 commit comments

Comments
 (0)