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
Next Next commit
Move UnitGenericAbstractType To Nunit
  • Loading branch information
falfaddaghi committed Jul 19, 2019
commit 5b633be46f1b89689d91c6f0ea06c8158ec7d97c
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 @@ -35,6 +35,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\SourceTextTests.fs" />
<Compile Include="Compiler\Language\AnonRecordTests.fs" />
<Compile Include="Compiler\Language\SpanOptimizationTests.fs" />
Expand Down

This file was deleted.

This file was deleted.