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
Copy file name to clipboardExpand all lines: tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs
+39Lines changed: 39 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -858,3 +858,42 @@ let main _ =
858
858
|> withLangVersion70
859
859
|> compile
860
860
|> shouldSucceed
861
+
862
+
[<FactForNETCOREAPP>]
863
+
let``Static abstracts can be inherited through multiple levels in lang version70`` ()=
864
+
Fsx """
865
+
type IParseable<'T when 'T :> IParseable<'T>> =
866
+
static abstract member Parse : string -> 'T
867
+
868
+
type IAction1<'T when 'T :> IAction1<'T>> =
869
+
inherit IParseable<'T>
870
+
871
+
type IAction2<'T when 'T :> IAction2<'T>> =
872
+
inherit IAction1<'T>
873
+
static abstract member AltParse : string -> 'T
874
+
875
+
type IAction3<'T when 'T :> IAction3<'T>> =
876
+
inherit IAction2<'T>
877
+
878
+
type SomeAction = A | B with
879
+
interface IAction3<SomeAction> with
880
+
static member AltParse (s: string) : SomeAction = A
881
+
static member Parse (s: string) : SomeAction =
882
+
match s with
883
+
| "A" -> A
884
+
| "B" -> B
885
+
| _ -> failwith "can't parse"
886
+
887
+
let parse<'T when 'T :> IParseable<'T>> (x: string) : 'T = 'T.Parse x
888
+
let altParse<'T when 'T :> IAction3<'T>> (x: string) : 'T = 'T.AltParse x
0 commit comments