Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/fsharp/FSharp.Core/prim-types-prelude.fs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ namespace Microsoft.FSharp.Core
type bool = System.Boolean
type decimal = System.Decimal
type int = int32
type uint = uint32

type ``[]``<'T> = (# "!0[]" #)
type ``[,]``<'T> = (# "!0[0 ...,0 ...]" #)
Expand Down
3 changes: 3 additions & 0 deletions src/fsharp/FSharp.Core/prim-types-prelude.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ namespace Microsoft.FSharp.Core
/// <summary>An abbreviation for the CLI type <c>System.Int32</c>.</summary>
type int = int32

/// <summary>An abbreviation for the CLI type <c>System.UInt32</c>.</summary>
type uint = uint32

/// <summary>Single dimensional, zero-based arrays, written <c>int[]</c>, <c>string[]</c> etc.</summary>
/// <remarks>Use the values in the <c>Array</c> module to manipulate values
/// of this type, or the notation <c>arr.[x]</c> to get/set array
Expand Down
10 changes: 10 additions & 0 deletions tests/fsharp/Compiler/Language/UIntTests.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace FSharp.Compiler.UnitTests

open NUnit.Framework

[<TestFixture>]
module UIntTests =
let ``uint type abbreviation works`` () =
let src = "let x = uint 12"
let expectedErrors = [||]
CompilerAssert.TypeCheckWithErrors src expectedErrors
1 change: 1 addition & 0 deletions tests/fsharp/FSharpSuite.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
<Compile Include="Compiler\Warnings\ExperimentalAttributeTests.fs" />
<Compile Include="Compiler\Warnings\PatternMatchingWarningTests.fs" />
<Compile Include="Compiler\SourceTextTests.fs" />
<Compile Include="Compiler\Language\UIntTests.fs" />
<Compile Include="Compiler\Language\FixedIndexSliceTests.fs" />
<Compile Include="Compiler\Language\SlicingQuotationTests.fs" />
<Compile Include="Compiler\Language\CustomCollectionTests.fs" />
Expand Down