Skip to content

Commit d4866e4

Browse files
falfaddaghibaronfel
authored andcommitted
Move UnitGenericAbstractType To Nunit (#7257)
1 parent 81d240b commit d4866e4

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
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+

0 commit comments

Comments
 (0)