Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/release-notes/.FSharp.Compiler.Service/8.0.300.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* `nameof Module` expressions and patterns are processed to link files in `--test:GraphBasedChecking`. ([PR #16550](https://github.com/dotnet/fsharp/pull/16550))
* Graph Based Checking doesn't throw on invalid parsed input so it can be used for IDE scenarios ([PR #16575](https://github.com/dotnet/fsharp/pull/16575), [PR #16588](https://github.com/dotnet/fsharp/pull/16588), [PR #16643](https://github.com/dotnet/fsharp/pull/16643))
* Keep parens for problematic exprs (`if`, `match`, etc.) in `$"{(…):N0}"`, `$"{(…),-3}"`, etc. ([PR #16578](https://github.com/dotnet/fsharp/pull/16578))
* Fix crash in DOTNET_SYSTEM_GLOBALIZATION_INVARIANT mode [#PR 16471](https://github.com/dotnet/fsharp/pull/16471))

* Fix crash in DOTNET_SYSTEM_GLOBALIZATION_INVARIANT mode ([PR #16471](https://github.com/dotnet/fsharp/pull/16471))
* `[<CliEvent>]` member should not produce property symbol. ([Issue #16640](https://github.com/dotnet/fsharp/issues/16640), [PR #16658](https://github.com/dotnet/fsharp/pull/16658))

### Added

Expand Down
4 changes: 2 additions & 2 deletions src/Compiler/Checking/CheckDeclarations.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1140,11 +1140,11 @@ module MutRecBindingChecking =
for b1, b2 in List.pairwise defnAs do
match b1, b2 with
| TyconBindingPhase2A.Phase2AMember {
SyntacticBinding = NormalizedBinding(pat = SynPat.Named(ident = SynIdent(ident = getIdent)); valSynData = SynValData(memberFlags = Some mf))
SyntacticBinding = NormalizedBinding(pat = SynPat.Named(ident = SynIdent(ident = Get_OrSet_Ident & getIdent)); valSynData = SynValData(memberFlags = Some mf))
RecBindingInfo = RecursiveBindingInfo(vspec = vGet)
},
TyconBindingPhase2A.Phase2AMember {
SyntacticBinding = NormalizedBinding(pat = SynPat.Named(ident = SynIdent(ident = setIdent)))
SyntacticBinding = NormalizedBinding(pat = SynPat.Named(ident = SynIdent(ident = Get_OrSet_Ident & setIdent)))
RecBindingInfo = RecursiveBindingInfo(vspec = vSet)
} when Range.equals getIdent.idRange setIdent.idRange ->
match vGet.ApparentEnclosingEntity with
Expand Down
6 changes: 6 additions & 0 deletions src/Compiler/SyntaxTree/SyntaxTreeOps.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1062,3 +1062,9 @@ let (|TypesForTypar|) (t: SynType) =
| _ -> continuation [ t ]

visit id t

[<return: Struct>]
let (|Get_OrSet_Ident|_|) (ident: Ident) =
if ident.idText.StartsWithOrdinal("get_") then ValueSome()
elif ident.idText.StartsWithOrdinal("set_") then ValueSome()
else ValueNone
4 changes: 4 additions & 0 deletions src/Compiler/SyntaxTree/SyntaxTreeOps.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -355,3 +355,7 @@ val getTypeFromTuplePath: path: SynTupleTypeSegment list -> SynType list
val (|MultiDimensionArrayType|_|): t: SynType -> (int * SynType * range) voption

val (|TypesForTypar|): t: SynType -> SynType list

/// Generated get_XYZ or set_XYZ ident text
[<return: Struct>]
val (|Get_OrSet_Ident|_|): Ident -> unit voption
21 changes: 21 additions & 0 deletions tests/service/Symbols.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1203,3 +1203,24 @@ type T() =
let i = 1
"""
assertHasSymbolUsages ["i"] checkResults

module Event =
[<Test>]
let ``CLIEvent member does not produce additional property symbol`` () =
let _, checkResults = getParseAndCheckResults """
type T() =
[<CLIEvent>]
member this.Event = Event<int>().Publish
"""
let allSymbols =
checkResults.GetSymbolUsesAtLocation(4, 21, " member this.Event = Event<int>().Publish", [ "Event" ])

let hasPropertySymbols =
allSymbols
|> List.exists (fun su ->
match su.Symbol with
| :? FSharpMemberOrFunctionOrValue as mfv -> mfv.IsProperty
| _ -> false
)

Assert.False hasPropertySymbols