Skip to content

Commit 0aacd63

Browse files
KevinRansomcartermp
authored andcommitted
Re-enable tests fixed by: #6620 (#6624)
1 parent c07e18b commit 0aacd63

File tree

2 files changed

+43
-48
lines changed

2 files changed

+43
-48
lines changed

tests/fsharp/core/csext/test.fsx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,15 @@ xie.All(fun x -> x > 1)
3232
xie.Average()
3333
x.Average()
3434

35-
// BUGBUG: https://github.com/Microsoft/visualfsharp/issues/6601
36-
//[<Struct>]
37-
//type S(v:int) =
38-
// interface System.Collections.Generic.IEnumerable<int> with
39-
// member x.GetEnumerator() = (Seq.singleton v).GetEnumerator()
40-
// interface System.Collections.IEnumerable with
41-
// member x.GetEnumerator() = ((Seq.singleton v).GetEnumerator() :> System.Collections.IEnumerator)
42-
//
43-
//let s : S = S(3)
44-
//s.Average()
35+
[<Struct>]
36+
type S(v:int) =
37+
interface System.Collections.Generic.IEnumerable<int> with
38+
member x.GetEnumerator() = (Seq.singleton v).GetEnumerator()
39+
interface System.Collections.IEnumerable with
40+
member x.GetEnumerator() = ((Seq.singleton v).GetEnumerator() :> System.Collections.IEnumerator)
41+
42+
let s : S = S(3)
43+
s.Average()
4544

4645

4746
[<Struct>]

tests/fsharp/core/libtest/test.fsx

Lines changed: 34 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4918,15 +4918,14 @@ type ToStringClass(x) =
49184918
end
49194919
do check "Bug1049.customClass" (string (ToStringClass("fred"))) "fred"
49204920

4921-
// BUGBUG: https://github.com/Microsoft/visualfsharp/issues/6597
4922-
// [<Struct>]
4923-
// type ToStringStruct =
4924-
// struct
4925-
// val x : int
4926-
// new(x) = {x=x}
4927-
// override this.ToString() = string this.x
4928-
// end
4929-
// do check "Bug1049.customStruct" (string (ToStringStruct(123))) "123"
4921+
[<Struct>]
4922+
type ToStringStruct =
4923+
struct
4924+
val x : int
4925+
new(x) = {x=x}
4926+
override this.ToString() = string this.x
4927+
end
4928+
do check "Bug1049.customStruct" (string (ToStringStruct(123))) "123"
49304929
type ToStringEnum =
49314930
| A = 1
49324931
| B = 2
@@ -5426,35 +5425,32 @@ module SetToString = begin
54265425
do check "cewjhnkrveo81p" ((Map.ofList [(4,40);(3,30);(2,20);(1,10)]) |> sprintf "%A") "map [(1, 10); (2, 20); (3, 30); (4, 40)]"
54275426
end
54285427

5429-
// BUGBUG: https://github.com/Microsoft/visualfsharp/issues/6599
5430-
5431-
//(*---------------------------------------------------------------------------
5432-
//!* Bug 5816: Unable to define mutually recursive types with mutually recursive generic constraints within FSI
5433-
// *--------------------------------------------------------------------------- *)
5434-
//module Bug5816 = begin
5435-
// type IView<'v, 'vm when 'v :> IView<'v,'vm> and 'vm :> IViewModel<'v,'vm>> = interface
5436-
// abstract ViewModel : 'vm
5437-
// end
5438-
// and IViewModel<'v, 'vm when 'v :> IView<'v,'vm> and 'vm :> IViewModel<'v,'vm>> = interface
5439-
// abstract View : 'v
5440-
// end
5441-
//end
5442-
5443-
// BUGBUG: https://github.com/Microsoft/visualfsharp/issues/6600
5444-
//(*---------------------------------------------------------------------------
5445-
//!* Bug 5825: Constraints with nested types
5446-
// *--------------------------------------------------------------------------- *)
5447-
//module Bug5825 = begin
5448-
// type I = interface
5449-
// abstract member m : unit
5450-
// end
5451-
// type C() = class
5452-
// interface I with
5453-
// member this.m = ()
5454-
// end
5455-
// end
5456-
// let f (c : #C) = ()
5457-
//end
5428+
(*---------------------------------------------------------------------------
5429+
!* Bug 5816: Unable to define mutually recursive types with mutually recursive generic constraints within FSI
5430+
*--------------------------------------------------------------------------- *)
5431+
module Bug5816 = begin
5432+
type IView<'v, 'vm when 'v :> IView<'v,'vm> and 'vm :> IViewModel<'v,'vm>> = interface
5433+
abstract ViewModel : 'vm
5434+
end
5435+
and IViewModel<'v, 'vm when 'v :> IView<'v,'vm> and 'vm :> IViewModel<'v,'vm>> = interface
5436+
abstract View : 'v
5437+
end
5438+
end
5439+
5440+
(*---------------------------------------------------------------------------
5441+
!* Bug 5825: Constraints with nested types
5442+
*--------------------------------------------------------------------------- *)
5443+
module Bug5825 = begin
5444+
type I = interface
5445+
abstract member m : unit
5446+
end
5447+
type C() = class
5448+
interface I with
5449+
member this.m = ()
5450+
end
5451+
end
5452+
let f (c : #C) = ()
5453+
end
54585454

54595455
module Bug5981 = begin
54605456
// guard against type variable tokens leaking into the IL stream

0 commit comments

Comments
 (0)