Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge dev16.2 to fsharp5 #6724

Merged
2 commits merged into from
May 14, 2019
Merged
Changes from all 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
24 changes: 18 additions & 6 deletions src/fsharp/symbols/Symbols.fs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.

namespace FSharp.Compiler.SourceCodeServices

Expand Down Expand Up @@ -1393,7 +1393,12 @@ and FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) =
let mkEventSym einfo = FSharpMemberOrFunctionOrValue(cenv, E einfo, Item.Event einfo)

new (cenv, vref) = FSharpMemberFunctionOrValue(cenv, V vref, Item.Value vref)
new (cenv, minfo) = FSharpMemberFunctionOrValue(cenv, M minfo, Item.MethodGroup(minfo.LogicalName, [minfo], None))

new (cenv, minfo: MethInfo) =
if minfo.IsConstructor || minfo.IsClassConstructor then
FSharpMemberFunctionOrValue(cenv, C minfo, Item.CtorGroup(minfo.LogicalName, [minfo]))
else
FSharpMemberFunctionOrValue(cenv, M minfo, Item.MethodGroup(minfo.LogicalName, [minfo], None))

member __.IsUnresolved =
isUnresolved()
Expand All @@ -1407,16 +1412,22 @@ and FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) =
member x.Overloads matchParameterNumber =
checkIsResolved()
match d with
| M m ->
| M m | C m ->
match item with
| Item.MethodGroup (_name, methodInfos, _) ->
| Item.MethodGroup (_, methodInfos, _)
| Item.CtorGroup (_, methodInfos) ->
let isConstructor = x.IsConstructor
let methods =
if matchParameterNumber then
methodInfos
|> List.filter (fun methodInfo -> not (methodInfo.NumArgs = m.NumArgs) )
else methodInfos
methods
|> List.map (fun mi -> FSharpMemberOrFunctionOrValue(cenv, M mi, item))
|> List.map (fun mi ->
if isConstructor then
FSharpMemberOrFunctionOrValue(cenv, C mi, item)
else
FSharpMemberOrFunctionOrValue(cenv, M mi, item))
|> makeReadOnlyCollection
|> Some
| _ -> None
Expand Down Expand Up @@ -1997,7 +2008,8 @@ and FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) =
match d, other.Data with
| E evt1, E evt2 -> EventInfo.EventInfosUseIdenticalDefintions evt1 evt2
| P p1, P p2 -> PropInfo.PropInfosUseIdenticalDefinitions p1 p2
| M m1, M m2 -> MethInfo.MethInfosUseIdenticalDefinitions m1 m2
| M m1, M m2
| C m1, C m2 -> MethInfo.MethInfosUseIdenticalDefinitions m1 m2
| V v1, V v2 -> valRefEq cenv.g v1 v2
| _ -> false
| _ -> false
Expand Down