File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
tests/FSharp.Compiler.Service.Tests Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -1271,3 +1271,33 @@ type T() =
12711271 )
12721272
12731273 Assert.False hasPropertySymbols
1274+
1275+ module Delegates =
1276+ [<Fact>]
1277+ let ``IL metadata`` () =
1278+ let _ , checkResults = getParseAndCheckResults """
1279+ module Delegates
1280+ open System
1281+
1282+ typeof<Delegate>
1283+ typeof<MulticastDelegate>
1284+ typeof<EventHandler>
1285+ typeof<Action>
1286+ """
1287+
1288+ let symbols =
1289+ checkResults.GetAllUsesOfAllSymbolsInFile()
1290+ |> Seq.choose ( fun su -> match su.Symbol with :? FSharpEntity as entity -> Some entity | _ -> None)
1291+ |> Seq.map ( fun su -> su.DisplayName, su)
1292+ |> dict
1293+
1294+ let delegateType = symbols[ " Delegate" ]
1295+ delegateType.IsDelegate |> shouldEqual false
1296+ delegateType.IsClass |> shouldEqual true
1297+
1298+ let multicastDelegateType = symbols[ " MulticastDelegate" ]
1299+ multicastDelegateType.IsDelegate |> shouldEqual false
1300+ multicastDelegateType.IsClass |> shouldEqual true
1301+
1302+ symbols[ " EventHandler" ]. IsDelegate |> shouldEqual true
1303+ symbols[ " Action" ]. IsDelegate |> shouldEqual true
You can’t perform that action at this time.
0 commit comments