Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<ProductDependencies>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.19361.7">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.19362.5">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>f1b09644408f45f43f5835786b3e4bdfd2e78141</Sha>
<Sha>15f50ca6a9d0b441c9927421657fb9dc91206cc9</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19361.7",
"Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19362.5",
"Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2"
}
}
3 changes: 2 additions & 1 deletion src/fsharp/IlxGen.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2533,7 +2533,8 @@ and GenAllocUnionCase cenv cgbuf eenv (c,tyargs,args,m) sequel =
GenSequel cenv eenv.cloc cgbuf sequel

and GenLinearExpr cenv cgbuf eenv sp expr sequel canProcessSequencePoint (contf: FakeUnit -> FakeUnit) =
match stripExpr expr with
let expr = stripExpr expr
match expr with
| LinearOpExpr (TOp.UnionCase c, tyargs, argsFront, argLast, m) ->
GenExprs cenv cgbuf eenv argsFront
GenLinearExpr cenv cgbuf eenv SPSuppress argLast Continue (* canProcessSequencePoint *) true (contf << (fun Fake ->
Expand Down
3 changes: 3 additions & 0 deletions tests/fsharp/Compiler/CompilerAssert.fs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ module CompilerAssert =
let errors = p.StandardError.ReadToEnd ()
if not (String.IsNullOrWhiteSpace errors) then
Assert.Fail errors

if p.ExitCode <> 0 then
Assert.Fail(sprintf "Program exited with exit code %d" p.ExitCode)
)

let CompileLibraryAndVerifyIL (source: string) (f: ILVerifier -> unit) =
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.

namespace FSharp.Compiler.UnitTests

open NUnit.Framework
open FSharp.Compiler.SourceCodeServices

[<TestFixture>]
module ``Access Of Type Abbreviation`` =

[<Test>]
let ``Test1``() =
CompilerAssert.TypeCheckSingleError
"""
module Library =
type private Hidden = Hidden of unit
type Exported = Hidden
"""
FSharpErrorSeverity.Warning
44
(4, 8, 4, 16)
"This construct is deprecated. The type 'Hidden' is less accessible than the value, member or type 'Exported' it is used in.\r\nAs of F# 4.1, the accessibility of type abbreviations is checked at compile-time. Consider changing the accessibility of the type abbreviation. Ignoring this warning might lead to runtime errors."

[<Test>]
let ``Test2``() =
CompilerAssert.Pass
"""
module Library =
type internal Hidden = Hidden of unit
type internal Exported = Hidden
"""

[<Test>]
let ``Test3``() =
CompilerAssert.TypeCheckSingleError
"""
module Library =
type internal Hidden = Hidden of unit
type Exported = Hidden
"""
FSharpErrorSeverity.Warning
44
(4, 8, 4, 16)
"This construct is deprecated. The type 'Hidden' is less accessible than the value, member or type 'Exported' it is used in.\r\nAs of F# 4.1, the accessibility of type abbreviations is checked at compile-time. Consider changing the accessibility of the type abbreviation. Ignoring this warning might lead to runtime errors."

[<Test>]
let ``Test4``() =
CompilerAssert.TypeCheckSingleError
"""
module Library =
type private Hidden = Hidden of unit
type internal Exported = Hidden
"""
FSharpErrorSeverity.Warning
44
(4, 17, 4, 25)
"This construct is deprecated. The type 'Hidden' is less accessible than the value, member or type 'Exported' it is used in.\r\nAs of F# 4.1, the accessibility of type abbreviations is checked at compile-time. Consider changing the accessibility of the type abbreviation. Ignoring this warning might lead to runtime errors."

[<Test>]
let ``Test5``() =
CompilerAssert.Pass
"""
module Library =
type private Hidden = Hidden of unit
type private Exported = Hidden
"""

[<Test>]
let ``Test6``() =
CompilerAssert.Pass
"""
module Library =
type Hidden = Hidden of unit
type Exported = Hidden
"""
1 change: 1 addition & 0 deletions tests/fsharp/FSharpSuite.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<Compile Include="tests.fs" />
<Compile Include="Compiler\ILChecker.fs" />
<Compile Include="Compiler\CompilerAssert.fs" />
<Compile Include="Compiler\ErrorMessages\AccessOfTypeAbbreviationTests.fs" />
<Compile Include="Compiler\ErrorMessages\ElseBranchHasWrongTypeTests.fs" />
<Compile Include="Compiler\ErrorMessages\MissingElseBranch.fs" />
<Compile Include="Compiler\SourceTextTests.fs" />
Expand Down
8 changes: 0 additions & 8 deletions tests/fsharpqa/Source/Warnings/AccessOfTypeAbbreviation.fs

This file was deleted.

8 changes: 0 additions & 8 deletions tests/fsharpqa/Source/Warnings/AccessOfTypeAbbreviation2.fs

This file was deleted.

8 changes: 0 additions & 8 deletions tests/fsharpqa/Source/Warnings/AccessOfTypeAbbreviation3.fs

This file was deleted.

8 changes: 0 additions & 8 deletions tests/fsharpqa/Source/Warnings/AccessOfTypeAbbreviation4.fs

This file was deleted.

8 changes: 0 additions & 8 deletions tests/fsharpqa/Source/Warnings/AccessOfTypeAbbreviation5.fs

This file was deleted.

8 changes: 0 additions & 8 deletions tests/fsharpqa/Source/Warnings/AccessOfTypeAbbreviation6.fs

This file was deleted.

6 changes: 0 additions & 6 deletions tests/fsharpqa/Source/Warnings/env.lst
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@
SOURCE=WrongArity.fs # WrongArity.fs
SOURCE=OverrideErrors.fs # OverrideErrors.fs
SOURCE=MethodIsNotStatic.fs # MethodIsNotStatic.fs
SOURCE=AccessOfTypeAbbreviation.fs # AccessOfTypeAbbreviation.fs
SOURCE=AccessOfTypeAbbreviation2.fs # AccessOfTypeAbbreviation2.fs
SOURCE=AccessOfTypeAbbreviation3.fs # AccessOfTypeAbbreviation3.fs
SOURCE=AccessOfTypeAbbreviation4.fs # AccessOfTypeAbbreviation4.fs
SOURCE=AccessOfTypeAbbreviation5.fs # AccessOfTypeAbbreviation5.fs
SOURCE=AccessOfTypeAbbreviation6.fs # AccessOfTypeAbbreviation6.fs
SOURCE=EqualsInsteadOfInInForLoop.fs # EqualsInsteadOfInInForLoop.fs
SOURCE=DontWarnExternalFunctionAsUnused.fs SCFLAGS="--warnon:1182 --warnaserror+" # DontWarnExternalFunctionAsUnused.fs
SOURCE=SuggestTypesInModule.fs # SuggestTypesInModule.fs
Expand Down