Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move UnitGenericAbstractType To Nunit #7257

Merged
merged 2 commits into from
Jul 19, 2019
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
27 changes: 27 additions & 0 deletions tests/fsharp/Compiler/ErrorMessages/UnitGenericAbstactType.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// 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 ``Unit generic abstract Type`` =

[<Test>]
let ``Unit can not be used as return type of abstract method paramete on return type``() =
CompilerAssert.TypeCheckSingleError
"""
type EDF<'S> =
abstract member Apply : int -> 'S
type SomeEDF () =
interface EDF<unit> with
member this.Apply d =
// [ERROR] The member 'Apply' does not have the correct type to override the corresponding abstract method.
()
"""
FSharpErrorSeverity.Error
17
(6, 21, 6, 26)
"The member 'Apply : int -> unit' is specialized with 'unit' but 'unit' can't be used as return type of an abstract method parameterized on return type."

1 change: 1 addition & 0 deletions tests/fsharp/FSharpSuite.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<Compile Include="Compiler\ErrorMessages\AccessOfTypeAbbreviationTests.fs" />
<Compile Include="Compiler\ErrorMessages\ElseBranchHasWrongTypeTests.fs" />
<Compile Include="Compiler\ErrorMessages\MissingElseBranch.fs" />
<Compile Include="Compiler\ErrorMessages\UnitGenericAbstactType.fs" />
<Compile Include="Compiler\ErrorMessages\NameResolutionTests.fs" />
<Compile Include="Compiler\ErrorMessages\UpcastDowncastTests.fs" />
<Compile Include="Compiler\ErrorMessages\AssignmentErrorTests.fs" />
Expand Down

This file was deleted.

This file was deleted.