"Fossies" - the Fresh Open Source Software Archive

Member "fsharp-4.5/tests/fsharp/core/span/test3.fsx" (5 Sep 2018, 1379 Bytes) of package /linux/misc/mono-sources/fsharp/fsharp-4.5.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) F# source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #r @"..\..\..\..\packages\System.Memory.4.5.0-rc1\lib\netstandard2.0\System.Memory.dll"
    2 #r @"..\..\..\..\packages\NETStandard.Library.NETFramework.2.0.0-preview2-25405-01\build\net461\ref\netstandard.dll"
    3 
    4 #nowarn "9"
    5 #nowarn "51"
    6 
    7 namespace System.Runtime.CompilerServices
    8 
    9     open System
   10     open System.Runtime.CompilerServices
   11     open System.Runtime.InteropServices
   12     [<AttributeUsage(AttributeTargets.All,AllowMultiple=false)>]
   13     [<Sealed>]
   14     type IsReadOnlyAttribute() =
   15         inherit System.Attribute()
   16 
   17     [<AttributeUsage(AttributeTargets.All,AllowMultiple=false)>]
   18     [<Sealed>]
   19     type IsByRefLikeAttribute() =
   20         inherit System.Attribute()
   21 
   22 namespace Tests
   23 
   24 open System
   25 
   26 // NOT POST INFERENCE CHECKS
   27 #if NEGATIVE
   28     module ForEachDeferenceSpanElementCheck =
   29         let doSomething (s: Span<int>) =
   30             for x in s do
   31                 x <- 5
   32                 ()
   33 
   34     module ForEachDereferenceSpanElementSeqCheck =
   35         let doSomething () =
   36             seq {
   37                 let s = Span<int>.Empty
   38                 for x in s do
   39                     x <- 5
   40                     yield x
   41             }
   42 
   43     module ForEachDereferenceSpanElementAsyncCheck =
   44         let doSomething () =
   45             async {
   46                 let s = Span<int>.Empty
   47                 for x in s do
   48                     x <- 5
   49                     ()
   50             }
   51 #endif