Skip to content

Commit 1a886f5

Browse files
committed
test
1 parent 121784a commit 1a886f5

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

tests/FSharp.Compiler.Service.Tests/Symbols.fs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)