diff --git a/src/Compiler/Checking/NicePrint.fs b/src/Compiler/Checking/NicePrint.fs index dbbe333b9cd..b7b4cce955f 100644 --- a/src/Compiler/Checking/NicePrint.fs +++ b/src/Compiler/Checking/NicePrint.fs @@ -875,16 +875,6 @@ module PrintTypes = | [] -> tcL | [arg] -> layoutTypeWithInfoAndPrec denv env 2 arg ^^ tcL | args -> bracketIfL (prec <= 1) (bracketL (layoutTypesWithInfoAndPrec denv env 2 (sepL (tagPunctuation ",")) args) --- tcL) - - and layoutTypeForGenericMultidimensionalArrays denv env prec tcref innerT level = - let innerLayout = layoutTypeWithInfoAndPrec denv env prec innerT - - let arrayLayout = - tagEntityRefName denv tcref $"array{level}d" - |> mkNav tcref.DefinitionRange - |> wordL - - innerLayout ^^ arrayLayout /// Layout a type, taking precedence into account to insert brackets where needed and layoutTypeWithInfoAndPrec denv env prec ty = @@ -906,10 +896,6 @@ module PrintTypes = // Always prefer 'float' to 'float<1>' | TType_app (tc, args, _) when tc.IsMeasureableReprTycon && List.forall (isDimensionless g) args -> layoutTypeWithInfoAndPrec denv env prec (reduceTyconRefMeasureableOrProvided g tc args) - - // Special case for nested array> shape - | TTypeMultiDimensionalArrayAsGeneric (tcref, innerT, level) -> - layoutTypeForGenericMultidimensionalArrays denv env prec tcref innerT level // Layout a type application | TType_ucase (UnionCaseRef(tc, _), args) diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index bc037c8af7e..c166230e718 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -10410,18 +10410,4 @@ let (|EmptyModuleOrNamespaces|_|) (moduleOrNamespaceContents: ModuleOrNamespaceC Some emptyModuleOrNamespaces else None - | _ -> None - -let (|TTypeMultiDimensionalArrayAsGeneric|_|) (t: TType) = - let rec (|Impl|_|) t = - match t with - | TType_app(tc, [Impl(outerTc, innerT, currentLevel)], _) when tc.DisplayNameCore = "array" -> - Some (outerTc, innerT, currentLevel + 1) - | TType_app(tc, [arg], _) when tc.DisplayNameCore = "array" -> - Some (tc, arg, 1) - | _ -> None - - match t with - | Impl (tc, arg, level) -> - if level > 2 then Some (tc, arg, level) else None - | _ -> None + | _ -> None \ No newline at end of file diff --git a/src/Compiler/TypedTree/TypedTreeOps.fsi b/src/Compiler/TypedTree/TypedTreeOps.fsi index 403498c5417..00d838e04d4 100755 --- a/src/Compiler/TypedTree/TypedTreeOps.fsi +++ b/src/Compiler/TypedTree/TypedTreeOps.fsi @@ -2687,6 +2687,3 @@ type TraitConstraintInfo with /// This will match anything that does not have any types or bindings. val (|EmptyModuleOrNamespaces|_|): moduleOrNamespaceContents: ModuleOrNamespaceContents -> (ModuleOrNamespace list) option - -/// Captures an application type with a multi-dimensional array as postfix. -val (|TTypeMultiDimensionalArrayAsGeneric|_|): t: TType -> (TyconRef * TType * int) option diff --git a/tests/FSharp.Compiler.ComponentTests/Signatures/ArrayTests.fs b/tests/FSharp.Compiler.ComponentTests/Signatures/ArrayTests.fs index 2317005032f..da6c65b1c82 100644 --- a/tests/FSharp.Compiler.ComponentTests/Signatures/ArrayTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Signatures/ArrayTests.fs @@ -32,17 +32,16 @@ let ``4 dimensional array`` () = "val a: int array4d" [] -let ``5 till 32 dimensional array`` () = - [ 5 .. 32 ] - |> List.iter (fun idx -> - let arrayType = - [ 1 .. idx ] - |> List.fold (fun acc _ -> $"array<{acc}>") "int" - - assertSingleSignatureBinding - $"let a : {arrayType} = failwith \"todo\"" - $"val a: int array{idx}d" - ) +let ``jagged array 1`` () = + assertSingleSignatureBinding + "let a : array>>>> = failwith \"todo\"" + "val a: int array array array array array" + +[] +let ``jagged array 2`` () = + assertSingleSignatureBinding + "let a: int[][][][][] = failwith \"todo\"" + "val a: int array array array array array" [] let ``Use array2d syntax in implementation`` () =