From bfee5e7f6004a784ad85ad0e0ccf83b335df2572 Mon Sep 17 00:00:00 2001 From: Dave Thomas <7sharp9@users.noreply.github.com> Date: Mon, 11 Mar 2019 12:33:38 +0000 Subject: [PATCH] Add an implementation of getting symbols for TraitConstraintSln.ILMethSln As discussed in #6307 @dsyme I added a tentative implementation, Im not entirely sure this is correct, also having trouble getting this to match an Item to test. --- src/fsharp/symbols/Symbols.fs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/fsharp/symbols/Symbols.fs b/src/fsharp/symbols/Symbols.fs index c1ddec999d8..91a52c4406b 100644 --- a/src/fsharp/symbols/Symbols.fs +++ b/src/fsharp/symbols/Symbols.fs @@ -292,6 +292,19 @@ type FSharpSymbol(cenv: SymbolEnv, item: (unit -> Item), access: (FSharpSymbol - | Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(_, vref, _)) }) -> FSharpMemberOrFunctionOrValue(cenv, V vref, item) :> _ + + | Item.ImplicitOp(_id, { contents = Some(TraitConstraintSln.ILMethSln(ttype, _iltyperef, ilMethRef, _typeInst)) }) -> + let tcref = + try + Import.ImportILTypeRef cenv.amap range0 ilMethRef.DeclaringTypeRef + with _ -> + let e = ilMethRef.DeclaringTypeRef + let parent = ILTypeRef.Create(e.Scope, e.Enclosing.Tail, e.Enclosing.Head) + Import.ImportILTypeRef cenv.amap range0 parent + + let mdef = resolveILMethodRefWithRescope unscopeILType tcref.ILTyconRawMetadata ilMethRef + let minfo = MethInfo.CreateILMeth(cenv.amap, range0, ttype, mdef) + FSharpMemberOrFunctionOrValue(cenv, M minfo, item) :> _ // TODO: the following don't currently return any interesting subtype | Item.ImplicitOp _