Skip to content

Commit

Permalink
Fix reporting symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
auduchinok committed May 17, 2023
1 parent f118e65 commit 1e3a5bb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/Compiler/Checking/CheckExpressions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1812,8 +1812,7 @@ let BuildFieldMap (cenv: cenv) env isPartial ty (flds: ((Ident list * Ident) * '
let fldPath, fldId = fld
let frefSet = ResolveField cenv.tcSink cenv.nameResolver env.eNameResEnv ad ty fldPath fldId allFields
Some(fld, frefSet, fldExpr)
with e ->
errorR e
with _ ->
None
)

Expand Down
15 changes: 15 additions & 0 deletions tests/service/Symbols.fs
Original file line number Diff line number Diff line change
Expand Up @@ -474,3 +474,18 @@ type Foo =
(:? FSharpMemberOrFunctionOrValue as setMfv) ->
Assert.AreNotEqual(getMfv.CurriedParameterGroups, setMfv.CurriedParameterGroups)
| _ -> Assert.Fail "Expected symbols to be FSharpMemberOrFunctionOrValue"

module Expressions =
[<Test>]
let ``Unresolved record field 01`` () =
let _, checkResults = getParseAndCheckResults """
type R1 =
{ F1: int
F2: int }
{ F = 1
F2 = 1 }
"""
getSymbolUses checkResults
|> Seq.exists (fun symbolUse -> symbolUse.IsFromUse && symbolUse.Symbol.DisplayName = "F2")
|> shouldEqual true

0 comments on commit 1e3a5bb

Please sign in to comment.