You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.
2
+
3
+
namespaceFSharp.Compiler.UnitTests
4
+
5
+
openNUnit.Framework
6
+
openFSharp.Compiler.SourceCodeServices
7
+
8
+
[<TestFixture>]
9
+
module``Unitgeneric abstractType`` =
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."
0 commit comments