-
Notifications
You must be signed in to change notification settings - Fork 830
Closed
Labels
Area-LangService-FindAllReferencesFind all references across projects and solutionsFind all references across projects and solutionsBugImpact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.(Internal MS Team use only) Describes an issue with moderate impact on existing code.
Milestone
Description
Repro steps
Code sample 1
module Foo
type MyType =
static member Two = 1
let x = MyType.Two
let y = MyType.Two
Code sample 2
module Foo
type MyType =
static member Two = 1
let x = MyType.Two
module MyType = do () // <-- Extra module with the same name as the type
let y = MyType.Two
- Find All References on
type MyType
Expected behavior
In both code samples we get the same results - 2 references to MyType
type.
Actual behavior
In code sample 2 the second reference (y
) is missing.
Known workarounds
None
Related information
The second occurrence is incorrectly stored in ItemKeyStore
as Item.ModuleOrNamespaces
instead of Item.Types
. This happens probably because in name resolution we find the identifier in modules, which are searched first.
fsharp/src/Compiler/Checking/NameResolution.fs
Line 3085 in 8e3b97b
moduleSearch ad () +++ tyconSearch ad +++ envSearch |
Metadata
Metadata
Assignees
Labels
Area-LangService-FindAllReferencesFind all references across projects and solutionsFind all references across projects and solutionsBugImpact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.(Internal MS Team use only) Describes an issue with moderate impact on existing code.
Type
Projects
Status
Done