@@ -88,6 +88,7 @@ let attribsOfSymbol (s:FSharpSymbol) =
8888 if v.IsImplicitConstructor then yield " ctor"
8989 if v.IsMutable then yield " mutable"
9090 if v.IsOverrideOrExplicitInterfaceImplementation then yield " overridemem"
91+ if v.IsInstanceMember && not v.IsInstanceMemberInCompiledCode then yield " funky"
9192 if v.IsExplicitInterfaceImplementation then yield " intfmem"
9293// if v.IsConstructorThisValue then yield "ctorthis"
9394// if v.IsMemberThisValue then yield "this"
@@ -202,7 +203,7 @@ let ``Test project1 whole project errors`` () =
202203 wholeProjectResults.Errors.[ 0 ]. EndColumn |> shouldEqual 44
203204
204205[<Test>]
205- let ``Test project39 should have protected FullName and TryFullName return same results`` () =
206+ let ``Test Project1 should have protected FullName and TryFullName return same results`` () =
206207 let wholeProjectResults = checker.ParseAndCheckProject( Project1.options) |> Async.RunSynchronously
207208 let rec getFullNameComparisons ( entity : FSharpEntity ) =
208209 seq { if not entity.IsProvided && entity.Accessibility.IsPublic then
@@ -4630,6 +4631,9 @@ let ``Test project37 typeof and arrays in attribute constructor arguments`` () =
46304631 |> Seq.map ( fun a -> a.AttributeType.CompiledName)
46314632 |> Array.ofSeq |> shouldEqual [| " AttrTestAttribute" ; " AttrTest2Attribute" |]
46324633
4634+ //-----------------------------------------------------------
4635+
4636+
46334637module Project38 =
46344638 open System.IO
46354639
@@ -4724,6 +4728,8 @@ let ``Test project38 abstract slot information`` () =
47244728 |]
47254729
47264730
4731+ //--------------------------------------------
4732+
47274733module Project39 =
47284734 open System.IO
47294735
@@ -4802,3 +4808,70 @@ let ``Test project39 all symbols`` () =
48024808 [[ " 'a" ]; [ " 'a0" ]; [ " 'a" ; " 'a0" ]]),
48034809 ( " return" , " 'b" ))]
48044810
4811+
4812+ //--------------------------------------------
4813+
4814+ module Project40 =
4815+ open System.IO
4816+
4817+ let fileName1 = Path.ChangeExtension( Path.GetTempFileName(), " .fs" )
4818+ let base2 = Path.GetTempFileName()
4819+ let dllName = Path.ChangeExtension( base2, " .dll" )
4820+ let projFileName = Path.ChangeExtension( base2, " .fsproj" )
4821+ let fileSource1 = """
4822+ module M
4823+
4824+ let f (x: option<_>) = x.IsSome, x.IsNone
4825+
4826+ [<CompilationRepresentation(CompilationRepresentationFlags.UseNullAsTrueValue)>]
4827+ type C =
4828+ | A
4829+ | B of string
4830+ member x.IsItAnA = match x with A -> true | B _ -> false
4831+ member x.IsItAnAMethod() = match x with A -> true | B _ -> false
4832+
4833+ let g (x: C) = x.IsItAnA,x.IsItAnAMethod()
4834+ """
4835+
4836+ File.WriteAllText( fileName1, fileSource1)
4837+ let fileNames = [ fileName1]
4838+ let args = mkProjectCommandLineArgs ( dllName, fileNames)
4839+ let options = checker.GetProjectOptionsFromCommandLineArgs ( projFileName, args)
4840+ let cleanFileName a = if a = fileName1 then " file1" else " ??"
4841+
4842+ [<Test>]
4843+ let ``Test Project40 all symbols`` () =
4844+
4845+ let wholeProjectResults = checker.ParseAndCheckProject( Project40.options) |> Async.RunSynchronously
4846+ let allSymbolUses = wholeProjectResults.GetAllUsesOfAllSymbols() |> Async.RunSynchronously
4847+ let allSymbolUsesInfo = [ for s in allSymbolUses -> s.Symbol.DisplayName, tups s.RangeAlternate, attribsOfSymbol s.Symbol ]
4848+ allSymbolUsesInfo |> shouldEqual
4849+ [( " option" , (( 4 , 10 ), ( 4 , 16 )), [ " abbrev" ]); ( " x" , (( 4 , 7 ), ( 4 , 8 )), []);
4850+ ( " x" , (( 4 , 23 ), ( 4 , 24 )), []);
4851+ ( " IsSome" , (( 4 , 23 ), ( 4 , 31 )), [ " member" ; " prop" ; " funky" ]);
4852+ ( " x" , (( 4 , 33 ), ( 4 , 34 )), []);
4853+ ( " IsNone" , (( 4 , 33 ), ( 4 , 41 )), [ " member" ; " prop" ; " funky" ]);
4854+ ( " f" , (( 4 , 4 ), ( 4 , 5 )), [ " val" ]);
4855+ ( " CompilationRepresentationAttribute" , (( 6 , 2 ), ( 6 , 27 )), [ " class" ]);
4856+ ( " CompilationRepresentationAttribute" , (( 6 , 2 ), ( 6 , 27 )), [ " class" ]);
4857+ ( " CompilationRepresentationAttribute" , (( 6 , 2 ), ( 6 , 27 )), [ " member" ]);
4858+ ( " CompilationRepresentationFlags" , (( 6 , 28 ), ( 6 , 58 )),
4859+ [ " enum" ; " valuetype" ]);
4860+ ( " UseNullAsTrueValue" , (( 6 , 28 ), ( 6 , 77 )), [ " field" ; " static" ; " 8" ]);
4861+ ( " string" , (( 9 , 11 ), ( 9 , 17 )), [ " abbrev" ]);
4862+ ( " string" , (( 9 , 11 ), ( 9 , 17 )), [ " abbrev" ]); ( " A" , (( 8 , 6 ), ( 8 , 7 )), []);
4863+ ( " B" , (( 9 , 6 ), ( 9 , 7 )), []); ( " C" , (( 7 , 5 ), ( 7 , 6 )), [ " union" ]);
4864+ ( " IsItAnA" , (( 10 , 13 ), ( 10 , 20 )), [ " member" ; " getter" ; " funky" ]);
4865+ ( " IsItAnAMethod" , (( 11 , 13 ), ( 11 , 26 )), [ " member" ; " funky" ]);
4866+ ( " x" , (( 10 , 11 ), ( 10 , 12 )), []); ( " x" , (( 10 , 29 ), ( 10 , 30 )), []);
4867+ ( " A" , (( 10 , 36 ), ( 10 , 37 )), []); ( " B" , (( 10 , 48 ), ( 10 , 49 )), []);
4868+ ( " x" , (( 11 , 11 ), ( 11 , 12 )), []); ( " x" , (( 11 , 37 ), ( 11 , 38 )), []);
4869+ ( " A" , (( 11 , 44 ), ( 11 , 45 )), []); ( " B" , (( 11 , 56 ), ( 11 , 57 )), []);
4870+ ( " C" , (( 13 , 10 ), ( 13 , 11 )), [ " union" ]); ( " x" , (( 13 , 7 ), ( 13 , 8 )), []);
4871+ ( " x" , (( 13 , 15 ), ( 13 , 16 )), []);
4872+ ( " IsItAnA" , (( 13 , 15 ), ( 13 , 24 )), [ " member" ; " prop" ; " funky" ]);
4873+ ( " x" , (( 13 , 25 ), ( 13 , 26 )), []);
4874+ ( " IsItAnAMethod" , (( 13 , 25 ), ( 13 , 40 )), [ " member" ; " funky" ]);
4875+ ( " g" , (( 13 , 4 ), ( 13 , 5 )), [ " val" ]); ( " M" , (( 2 , 7 ), ( 2 , 8 )), [ " module" ])]
4876+
4877+
0 commit comments