Skip to content

Commit

Permalink
Move UnitGenericAbstractType To Nunit (#7257)
Browse files Browse the repository at this point in the history
  • Loading branch information
falfaddaghi authored and KevinRansom committed Jul 19, 2019
1 parent 8d74566 commit c423de9
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 10 deletions.
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.

0 comments on commit c423de9

Please sign in to comment.