|  | 
|  | 1 | +// Copyright (c) Microsoft Corporation.  All Rights Reserved.  See License.txt in the project root for license information. | 
|  | 2 | + | 
|  | 3 | +module Language.IndexedSetTests | 
|  | 4 | + | 
|  | 5 | +open FSharp.Test.Compiler | 
|  | 6 | +open Xunit | 
|  | 7 | + | 
|  | 8 | +module Array = | 
|  | 9 | +    [<Fact>] | 
|  | 10 | +    let ``Dotless indexed set of parenthesized tuple compiles`` () = | 
|  | 11 | +        FSharp " | 
|  | 12 | +        let xs = Array.zeroCreate<int * int * int> 1 | 
|  | 13 | +        xs[0] <- (1, 2, 3) | 
|  | 14 | +        " | 
|  | 15 | +        |> typecheck | 
|  | 16 | +        |> shouldSucceed | 
|  | 17 | + | 
|  | 18 | +    [<Fact>] | 
|  | 19 | +    let ``Dotless indexed set of unparenthesized tuple compiles`` () = | 
|  | 20 | +        FSharp " | 
|  | 21 | +        let xs = Array.zeroCreate<int * int * int> 1 | 
|  | 22 | +        xs[0] <- 1, 2, 3 | 
|  | 23 | +        " | 
|  | 24 | +        |> typecheck | 
|  | 25 | +        |> shouldSucceed | 
|  | 26 | + | 
|  | 27 | +    [<Fact>] | 
|  | 28 | +    let ``Dotless indexed set of double-parenthesized tuple compiles`` () = | 
|  | 29 | +        FSharp " | 
|  | 30 | +        let xs = Array.zeroCreate<int * int * int> 1 | 
|  | 31 | +        xs[0] <- ((1, 2, 3)) | 
|  | 32 | +        " | 
|  | 33 | +        |> typecheck | 
|  | 34 | +        |> shouldSucceed | 
|  | 35 | + | 
|  | 36 | +    [<Fact>] | 
|  | 37 | +    let ``Dot-indexed set of parenthesized tuple compiles`` () = | 
|  | 38 | +        FSharp " | 
|  | 39 | +        let xs = Array.zeroCreate<int * int * int> 1 | 
|  | 40 | +        xs.[0] <- (1, 2, 3) | 
|  | 41 | +        " | 
|  | 42 | +        |> typecheck | 
|  | 43 | +        |> shouldSucceed | 
|  | 44 | + | 
|  | 45 | +    [<Fact>] | 
|  | 46 | +    let ``Dot-indexed set of unparenthesized tuple compiles`` () = | 
|  | 47 | +        FSharp " | 
|  | 48 | +        let xs = Array.zeroCreate<int * int * int> 1 | 
|  | 49 | +        xs.[0] <- 1, 2, 3 | 
|  | 50 | +        " | 
|  | 51 | +        |> typecheck | 
|  | 52 | +        |> shouldSucceed | 
|  | 53 | + | 
|  | 54 | +    [<Fact>] | 
|  | 55 | +    let ``Dot-indexed set of double-parenthesized tuple compiles`` () = | 
|  | 56 | +        FSharp " | 
|  | 57 | +        let xs = Array.zeroCreate<int * int * int> 1 | 
|  | 58 | +        xs.[0] <- ((1, 2, 3)) | 
|  | 59 | +        " | 
|  | 60 | +        |> typecheck | 
|  | 61 | +        |> shouldSucceed | 
|  | 62 | + | 
|  | 63 | +module Dictionary = | 
|  | 64 | +    // Parsed as SynExpr.Set. | 
|  | 65 | +    [<Fact>] | 
|  | 66 | +    let ``Dotless indexed set of parenthesized tuple compiles`` () = | 
|  | 67 | +        FSharp " | 
|  | 68 | +        let xs = System.Collections.Generic.Dictionary<int, int * int * int> () | 
|  | 69 | +        xs[0] <- (1, 2, 3) | 
|  | 70 | +        " | 
|  | 71 | +        |> typecheck | 
|  | 72 | +        |> shouldSucceed | 
|  | 73 | + | 
|  | 74 | +    // Parsed as SynExpr.Set. | 
|  | 75 | +    [<Fact>] | 
|  | 76 | +    let ``Dotless indexed set of unparenthesized tuple compiles`` () = | 
|  | 77 | +        FSharp " | 
|  | 78 | +        let xs = System.Collections.Generic.Dictionary<int, int * int * int> () | 
|  | 79 | +        xs[0] <- 1, 2, 3 | 
|  | 80 | +        " | 
|  | 81 | +        |> typecheck | 
|  | 82 | +        |> shouldSucceed | 
|  | 83 | + | 
|  | 84 | +    // Parsed as SynExpr.Set. | 
|  | 85 | +    [<Fact>] | 
|  | 86 | +    let ``Dotless indexed set of double-parenthesized tuple compiles`` () = | 
|  | 87 | +        FSharp " | 
|  | 88 | +        let xs = System.Collections.Generic.Dictionary<int, int * int * int> () | 
|  | 89 | +        xs[0] <- ((1, 2, 3)) | 
|  | 90 | +        " | 
|  | 91 | +        |> typecheck | 
|  | 92 | +        |> shouldSucceed | 
|  | 93 | + | 
|  | 94 | +    // Parsed as SynExpr.DotIndexedSet. | 
|  | 95 | +    [<Fact>] | 
|  | 96 | +    let ``Dot-indexed set of parenthesized tuple compiles`` () = | 
|  | 97 | +        FSharp " | 
|  | 98 | +        let xs = System.Collections.Generic.Dictionary<int, int * int * int> () | 
|  | 99 | +        xs.[0] <- (1, 2, 3) | 
|  | 100 | +        " | 
|  | 101 | +        |> typecheck | 
|  | 102 | +        |> shouldSucceed | 
|  | 103 | + | 
|  | 104 | +    // Parsed as SynExpr.DotIndexedSet. | 
|  | 105 | +    [<Fact>] | 
|  | 106 | +    let ``Dot-indexed set of unparenthesized tuple compiles`` () = | 
|  | 107 | +        FSharp " | 
|  | 108 | +        let xs = System.Collections.Generic.Dictionary<int, int * int * int> () | 
|  | 109 | +        xs.[0] <- 1, 2, 3 | 
|  | 110 | +        " | 
|  | 111 | +        |> typecheck | 
|  | 112 | +        |> shouldSucceed | 
|  | 113 | + | 
|  | 114 | +    // Parsed as SynExpr.DotIndexedSet. | 
|  | 115 | +    [<Fact>] | 
|  | 116 | +    let ``Dot-indexed set of double-parenthesized tuple compiles`` () = | 
|  | 117 | +        FSharp " | 
|  | 118 | +        let xs = System.Collections.Generic.Dictionary<int, int * int * int> () | 
|  | 119 | +        xs.[0] <- ((1, 2, 3)) | 
|  | 120 | +        " | 
|  | 121 | +        |> typecheck | 
|  | 122 | +        |> shouldSucceed | 
|  | 123 | + | 
|  | 124 | +    // Parsed as SynExpr.NamedIndexedPropertySet. | 
|  | 125 | +    [<Fact>] | 
|  | 126 | +    let ``Named indexed property set of parenthesized tuple compiles`` () = | 
|  | 127 | +        FSharp " | 
|  | 128 | +        let xs = System.Collections.Generic.Dictionary<int, int * int * int> () | 
|  | 129 | +        xs.Item 0 <- (1, 2, 3) | 
|  | 130 | +        " | 
|  | 131 | +        |> typecheck | 
|  | 132 | +        |> shouldSucceed | 
|  | 133 | + | 
|  | 134 | +    // Parsed as SynExpr.NamedIndexedPropertySet. | 
|  | 135 | +    [<Fact>] | 
|  | 136 | +    let ``Named indexed property set of unparenthesized tuple compiles`` () = | 
|  | 137 | +        FSharp " | 
|  | 138 | +        let xs = System.Collections.Generic.Dictionary<int, int * int * int> () | 
|  | 139 | +        xs.Item 0 <- 1, 2, 3 | 
|  | 140 | +        " | 
|  | 141 | +        |> typecheck | 
|  | 142 | +        |> shouldSucceed | 
|  | 143 | + | 
|  | 144 | +    // Parsed as SynExpr.NamedIndexedPropertySet. | 
|  | 145 | +    [<Fact>] | 
|  | 146 | +    let ``Named indexed property set of double-parenthesized tuple compiles`` () = | 
|  | 147 | +        FSharp " | 
|  | 148 | +        let xs = System.Collections.Generic.Dictionary<int, int * int * int> () | 
|  | 149 | +        xs.Item 0 <- ((1, 2, 3)) | 
|  | 150 | +        " | 
|  | 151 | +        |> typecheck | 
|  | 152 | +        |> shouldSucceed | 
|  | 153 | + | 
|  | 154 | +    // Parsed as SynExpr.DotNamedIndexedPropertySet. | 
|  | 155 | +    [<Fact>] | 
|  | 156 | +    let ``Dot-named indexed property set of parenthesized tuple compiles`` () = | 
|  | 157 | +        FSharp " | 
|  | 158 | +        let xs = System.Collections.Generic.Dictionary<int, int * int * int> () | 
|  | 159 | +        (xs).Item 0 <- (1, 2, 3) | 
|  | 160 | +        " | 
|  | 161 | +        |> typecheck | 
|  | 162 | +        |> shouldSucceed | 
|  | 163 | + | 
|  | 164 | +    // Parsed as SynExpr.DotNamedIndexedPropertySet. | 
|  | 165 | +    [<Fact>] | 
|  | 166 | +    let ``Dot-named indexed property set of unparenthesized tuple compiles`` () = | 
|  | 167 | +        FSharp " | 
|  | 168 | +        let xs = System.Collections.Generic.Dictionary<int, int * int * int> () | 
|  | 169 | +        (xs).Item 0 <- 1, 2, 3 | 
|  | 170 | +        " | 
|  | 171 | +        |> typecheck | 
|  | 172 | +        |> shouldSucceed | 
|  | 173 | + | 
|  | 174 | +    // Parsed as SynExpr.DotNamedIndexedPropertySet. | 
|  | 175 | +    [<Fact>] | 
|  | 176 | +    let ``Dot-named indexed property set of double-parenthesized tuple compiles`` () = | 
|  | 177 | +        FSharp " | 
|  | 178 | +        let xs = System.Collections.Generic.Dictionary<int, int * int * int> () | 
|  | 179 | +        (xs).Item 0 <- ((1, 2, 3)) | 
|  | 180 | +        " | 
|  | 181 | +        |> typecheck | 
|  | 182 | +        |> shouldSucceed | 
0 commit comments