Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge master to fsharp5 #6633

Merged
4 commits merged into from
Apr 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions DEVGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ To build and test Visual F# IDE Tools, install these requirements:
- Launch the Visual Studio Installer
- Under the **"Windows"** workload, select **".NET desktop development"**
- Select the optional component **"F# desktop language support"**
- Under the **"Mobile & Gaming"** workload, select **"Mobile development with .NET"**
- Under the **"Other Toolsets"** workload, select **"Visual Studio extension development"**
- On the **"Individual Components"** tab, select **".NET Framework 4.7.2 SDK"** and **".NET Framework 4.7.2 targeting pack"**

Steps to build:

Expand Down
2 changes: 1 addition & 1 deletion src/fsharp/FSComp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1461,4 +1461,4 @@ notAFunctionButMaybeDeclaration,"This value is not a function and cannot be appl
3245,tcCopyAndUpdateNeedsRecordType,"The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record"
3300,chkInvalidFunctionParameterType,"The parameter '%s' has an invalid type '%s'. This is not permitted by the rules of Common IL."
3301,chkInvalidFunctionReturnType,"The function or method has an invalid return type '%s'. This is not permitted by the rules of Common IL."
useSdkRefs,"Use reference assemblies for DotNET framework references when available (Enabled by default))."
useSdkRefs,"Use reference assemblies for .NET framework references when available (Enabled by default)."
4 changes: 2 additions & 2 deletions src/fsharp/xlf/FSComp.txt.cs.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@
<note />
</trans-unit>
<trans-unit id="useSdkRefs">
<source>Use reference assemblies for DotNET framework references when available (Enabled by default)).</source>
<target state="new">Use reference assemblies for DotNET framework references when available (Enabled by default)).</target>
<source>Use reference assemblies for .NET framework references when available (Enabled by default).</source>
<target state="new">Use reference assemblies for .NET framework references when available (Enabled by default).</target>
<note />
</trans-unit>
<trans-unit id="yieldUsedInsteadOfYieldBang">
Expand Down
4 changes: 2 additions & 2 deletions src/fsharp/xlf/FSComp.txt.de.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@
<note />
</trans-unit>
<trans-unit id="useSdkRefs">
<source>Use reference assemblies for DotNET framework references when available (Enabled by default)).</source>
<target state="new">Use reference assemblies for DotNET framework references when available (Enabled by default)).</target>
<source>Use reference assemblies for .NET framework references when available (Enabled by default).</source>
<target state="new">Use reference assemblies for .NET framework references when available (Enabled by default).</target>
<note />
</trans-unit>
<trans-unit id="yieldUsedInsteadOfYieldBang">
Expand Down
4 changes: 2 additions & 2 deletions src/fsharp/xlf/FSComp.txt.es.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@
<note />
</trans-unit>
<trans-unit id="useSdkRefs">
<source>Use reference assemblies for DotNET framework references when available (Enabled by default)).</source>
<target state="new">Use reference assemblies for DotNET framework references when available (Enabled by default)).</target>
<source>Use reference assemblies for .NET framework references when available (Enabled by default).</source>
<target state="new">Use reference assemblies for .NET framework references when available (Enabled by default).</target>
<note />
</trans-unit>
<trans-unit id="yieldUsedInsteadOfYieldBang">
Expand Down
4 changes: 2 additions & 2 deletions src/fsharp/xlf/FSComp.txt.fr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@
<note />
</trans-unit>
<trans-unit id="useSdkRefs">
<source>Use reference assemblies for DotNET framework references when available (Enabled by default)).</source>
<target state="new">Use reference assemblies for DotNET framework references when available (Enabled by default)).</target>
<source>Use reference assemblies for .NET framework references when available (Enabled by default).</source>
<target state="new">Use reference assemblies for .NET framework references when available (Enabled by default).</target>
<note />
</trans-unit>
<trans-unit id="yieldUsedInsteadOfYieldBang">
Expand Down
4 changes: 2 additions & 2 deletions src/fsharp/xlf/FSComp.txt.it.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@
<note />
</trans-unit>
<trans-unit id="useSdkRefs">
<source>Use reference assemblies for DotNET framework references when available (Enabled by default)).</source>
<target state="new">Use reference assemblies for DotNET framework references when available (Enabled by default)).</target>
<source>Use reference assemblies for .NET framework references when available (Enabled by default).</source>
<target state="new">Use reference assemblies for .NET framework references when available (Enabled by default).</target>
<note />
</trans-unit>
<trans-unit id="yieldUsedInsteadOfYieldBang">
Expand Down
4 changes: 2 additions & 2 deletions src/fsharp/xlf/FSComp.txt.ja.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@
<note />
</trans-unit>
<trans-unit id="useSdkRefs">
<source>Use reference assemblies for DotNET framework references when available (Enabled by default)).</source>
<target state="new">Use reference assemblies for DotNET framework references when available (Enabled by default)).</target>
<source>Use reference assemblies for .NET framework references when available (Enabled by default).</source>
<target state="new">Use reference assemblies for .NET framework references when available (Enabled by default).</target>
<note />
</trans-unit>
<trans-unit id="yieldUsedInsteadOfYieldBang">
Expand Down
4 changes: 2 additions & 2 deletions src/fsharp/xlf/FSComp.txt.ko.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@
<note />
</trans-unit>
<trans-unit id="useSdkRefs">
<source>Use reference assemblies for DotNET framework references when available (Enabled by default)).</source>
<target state="new">Use reference assemblies for DotNET framework references when available (Enabled by default)).</target>
<source>Use reference assemblies for .NET framework references when available (Enabled by default).</source>
<target state="new">Use reference assemblies for .NET framework references when available (Enabled by default).</target>
<note />
</trans-unit>
<trans-unit id="yieldUsedInsteadOfYieldBang">
Expand Down
4 changes: 2 additions & 2 deletions src/fsharp/xlf/FSComp.txt.pl.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@
<note />
</trans-unit>
<trans-unit id="useSdkRefs">
<source>Use reference assemblies for DotNET framework references when available (Enabled by default)).</source>
<target state="new">Use reference assemblies for DotNET framework references when available (Enabled by default)).</target>
<source>Use reference assemblies for .NET framework references when available (Enabled by default).</source>
<target state="new">Use reference assemblies for .NET framework references when available (Enabled by default).</target>
<note />
</trans-unit>
<trans-unit id="yieldUsedInsteadOfYieldBang">
Expand Down
4 changes: 2 additions & 2 deletions src/fsharp/xlf/FSComp.txt.pt-BR.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@
<note />
</trans-unit>
<trans-unit id="useSdkRefs">
<source>Use reference assemblies for DotNET framework references when available (Enabled by default)).</source>
<target state="new">Use reference assemblies for DotNET framework references when available (Enabled by default)).</target>
<source>Use reference assemblies for .NET framework references when available (Enabled by default).</source>
<target state="new">Use reference assemblies for .NET framework references when available (Enabled by default).</target>
<note />
</trans-unit>
<trans-unit id="yieldUsedInsteadOfYieldBang">
Expand Down
4 changes: 2 additions & 2 deletions src/fsharp/xlf/FSComp.txt.ru.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@
<note />
</trans-unit>
<trans-unit id="useSdkRefs">
<source>Use reference assemblies for DotNET framework references when available (Enabled by default)).</source>
<target state="new">Use reference assemblies for DotNET framework references when available (Enabled by default)).</target>
<source>Use reference assemblies for .NET framework references when available (Enabled by default).</source>
<target state="new">Use reference assemblies for .NET framework references when available (Enabled by default).</target>
<note />
</trans-unit>
<trans-unit id="yieldUsedInsteadOfYieldBang">
Expand Down
4 changes: 2 additions & 2 deletions src/fsharp/xlf/FSComp.txt.tr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@
<note />
</trans-unit>
<trans-unit id="useSdkRefs">
<source>Use reference assemblies for DotNET framework references when available (Enabled by default)).</source>
<target state="new">Use reference assemblies for DotNET framework references when available (Enabled by default)).</target>
<source>Use reference assemblies for .NET framework references when available (Enabled by default).</source>
<target state="new">Use reference assemblies for .NET framework references when available (Enabled by default).</target>
<note />
</trans-unit>
<trans-unit id="yieldUsedInsteadOfYieldBang">
Expand Down
4 changes: 2 additions & 2 deletions src/fsharp/xlf/FSComp.txt.zh-Hans.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@
<note />
</trans-unit>
<trans-unit id="useSdkRefs">
<source>Use reference assemblies for DotNET framework references when available (Enabled by default)).</source>
<target state="new">Use reference assemblies for DotNET framework references when available (Enabled by default)).</target>
<source>Use reference assemblies for .NET framework references when available (Enabled by default).</source>
<target state="new">Use reference assemblies for .NET framework references when available (Enabled by default).</target>
<note />
</trans-unit>
<trans-unit id="yieldUsedInsteadOfYieldBang">
Expand Down
4 changes: 2 additions & 2 deletions src/fsharp/xlf/FSComp.txt.zh-Hant.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@
<note />
</trans-unit>
<trans-unit id="useSdkRefs">
<source>Use reference assemblies for DotNET framework references when available (Enabled by default)).</source>
<target state="new">Use reference assemblies for DotNET framework references when available (Enabled by default)).</target>
<source>Use reference assemblies for .NET framework references when available (Enabled by default).</source>
<target state="new">Use reference assemblies for .NET framework references when available (Enabled by default).</target>
<note />
</trans-unit>
<trans-unit id="yieldUsedInsteadOfYieldBang">
Expand Down
19 changes: 9 additions & 10 deletions tests/fsharp/core/csext/test.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,15 @@ xie.All(fun x -> x > 1)
xie.Average()
x.Average()

// BUGBUG: https://github.com/Microsoft/visualfsharp/issues/6601
//[<Struct>]
//type S(v:int) =
// interface System.Collections.Generic.IEnumerable<int> with
// member x.GetEnumerator() = (Seq.singleton v).GetEnumerator()
// interface System.Collections.IEnumerable with
// member x.GetEnumerator() = ((Seq.singleton v).GetEnumerator() :> System.Collections.IEnumerator)
//
//let s : S = S(3)
//s.Average()
[<Struct>]
type S(v:int) =
interface System.Collections.Generic.IEnumerable<int> with
member x.GetEnumerator() = (Seq.singleton v).GetEnumerator()
interface System.Collections.IEnumerable with
member x.GetEnumerator() = ((Seq.singleton v).GetEnumerator() :> System.Collections.IEnumerator)

let s : S = S(3)
s.Average()


[<Struct>]
Expand Down
72 changes: 34 additions & 38 deletions tests/fsharp/core/libtest/test.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -4918,15 +4918,14 @@ type ToStringClass(x) =
end
do check "Bug1049.customClass" (string (ToStringClass("fred"))) "fred"

// BUGBUG: https://github.com/Microsoft/visualfsharp/issues/6597
// [<Struct>]
// type ToStringStruct =
// struct
// val x : int
// new(x) = {x=x}
// override this.ToString() = string this.x
// end
// do check "Bug1049.customStruct" (string (ToStringStruct(123))) "123"
[<Struct>]
type ToStringStruct =
struct
val x : int
new(x) = {x=x}
override this.ToString() = string this.x
end
do check "Bug1049.customStruct" (string (ToStringStruct(123))) "123"
type ToStringEnum =
| A = 1
| B = 2
Expand Down Expand Up @@ -5426,35 +5425,32 @@ module SetToString = begin
do check "cewjhnkrveo81p" ((Map.ofList [(4,40);(3,30);(2,20);(1,10)]) |> sprintf "%A") "map [(1, 10); (2, 20); (3, 30); (4, 40)]"
end

// BUGBUG: https://github.com/Microsoft/visualfsharp/issues/6599

//(*---------------------------------------------------------------------------
//!* Bug 5816: Unable to define mutually recursive types with mutually recursive generic constraints within FSI
// *--------------------------------------------------------------------------- *)
//module Bug5816 = begin
// type IView<'v, 'vm when 'v :> IView<'v,'vm> and 'vm :> IViewModel<'v,'vm>> = interface
// abstract ViewModel : 'vm
// end
// and IViewModel<'v, 'vm when 'v :> IView<'v,'vm> and 'vm :> IViewModel<'v,'vm>> = interface
// abstract View : 'v
// end
//end

// BUGBUG: https://github.com/Microsoft/visualfsharp/issues/6600
//(*---------------------------------------------------------------------------
//!* Bug 5825: Constraints with nested types
// *--------------------------------------------------------------------------- *)
//module Bug5825 = begin
// type I = interface
// abstract member m : unit
// end
// type C() = class
// interface I with
// member this.m = ()
// end
// end
// let f (c : #C) = ()
//end
(*---------------------------------------------------------------------------
!* Bug 5816: Unable to define mutually recursive types with mutually recursive generic constraints within FSI
*--------------------------------------------------------------------------- *)
module Bug5816 = begin
type IView<'v, 'vm when 'v :> IView<'v,'vm> and 'vm :> IViewModel<'v,'vm>> = interface
abstract ViewModel : 'vm
end
and IViewModel<'v, 'vm when 'v :> IView<'v,'vm> and 'vm :> IViewModel<'v,'vm>> = interface
abstract View : 'v
end
end

(*---------------------------------------------------------------------------
!* Bug 5825: Constraints with nested types
*--------------------------------------------------------------------------- *)
module Bug5825 = begin
type I = interface
abstract member m : unit
end
type C() = class
interface I with
member this.m = ()
end
end
let f (c : #C) = ()
end

module Bug5981 = begin
// guard against type variable tokens leaking into the IL stream
Expand Down