Skip to content

Commit c423de9

Browse files
falfaddaghiKevinRansom
authored andcommitted
Move UnitGenericAbstractType To Nunit (#7257)
1 parent 8d74566 commit c423de9

4 files changed

Lines changed: 28 additions & 10 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.
2+
3+
namespace FSharp.Compiler.UnitTests
4+
5+
open NUnit.Framework
6+
open FSharp.Compiler.SourceCodeServices
7+
8+
[<TestFixture>]
9+
module ``Unit generic abstract Type`` =
10+
11+
[<Test>]
12+
let ``Unit can not be used as return type of abstract method paramete on return type``() =
13+
CompilerAssert.TypeCheckSingleError
14+
"""
15+
type EDF<'S> =
16+
abstract member Apply : int -> 'S
17+
type SomeEDF () =
18+
interface EDF<unit> with
19+
member this.Apply d =
20+
// [ERROR] The member 'Apply' does not have the correct type to override the corresponding abstract method.
21+
()
22+
"""
23+
FSharpErrorSeverity.Error
24+
17
25+
(6, 21, 6, 26)
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."
27+

tests/fsharp/FSharpSuite.Tests.fsproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
<Compile Include="Compiler\ErrorMessages\AccessOfTypeAbbreviationTests.fs" />
3737
<Compile Include="Compiler\ErrorMessages\ElseBranchHasWrongTypeTests.fs" />
3838
<Compile Include="Compiler\ErrorMessages\MissingElseBranch.fs" />
39+
<Compile Include="Compiler\ErrorMessages\UnitGenericAbstactType.fs" />
3940
<Compile Include="Compiler\ErrorMessages\NameResolutionTests.fs" />
4041
<Compile Include="Compiler\ErrorMessages\UpcastDowncastTests.fs" />
4142
<Compile Include="Compiler\ErrorMessages\AssignmentErrorTests.fs" />

tests/fsharpqa/Source/ErrorMessages/UnitGenericAbstractType/E_UnitGenericAbstractType1.fs

Lines changed: 0 additions & 9 deletions
This file was deleted.

tests/fsharpqa/Source/ErrorMessages/UnitGenericAbstractType/env.lst

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)