"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/fsharp/core/members/basics-hw/test.fsx" between
fsharp-4.1.33.tar.gz and fsharp-4.5.tar.gz

About: Mono is an open source implementation of Microsoft's .NET Framework based on the ECMA standards for C# and the Common Language Runtime. fsharp is the F# compiler and core library.

test.fsx  (fsharp-4.1.33):test.fsx  (fsharp-4.5)
skipping to change at line 59 skipping to change at line 59
let f(x) = let f(x) =
{ new RecordType2<'a,int> with a = x and b = 2 } { new RecordType2<'a,int> with a = x and b = 2 }
test "fweoew091" ((f(1)).a = 1) test "fweoew091" ((f(1)).a = 1)
test "fweoew092" ((f(1)).b = 2) test "fweoew092" ((f(1)).b = 2)
(f(1)).b <- 3 (f(1)).b <- 3
test "fweoew093" ((f(1)).b = 2) test "fweoew093" ((f(1)).b = 2)
open System open System
open System.Collections open System.Collections
#if !FX_PORTABLE_OR_NETSTANDARD #if !NETCOREAPP1_0
open System.Windows.Forms open System.Windows.Forms
#endif #endif
//----------------------------------------- //-----------------------------------------
// Some simple object-expression tests // Some simple object-expression tests
let x0 = { new System.Object() with member __.GetHashCode() = 3 } let x0 = { new System.Object() with member __.GetHashCode() = 3 }
#if !FX_PORTABLE_OR_NETSTANDARD #if !NETCOREAPP1_0
let x1 = { new System.Windows.Forms.Form() with member __.GetHashCode() = 3 } let x1 = { new System.Windows.Forms.Form() with member __.GetHashCode() = 3 }
#endif #endif
//----------------------------------------- //-----------------------------------------
// Test defining an F# class // Test defining an F# class
type ClassType1 = type ClassType1 =
class class
inherit System.Object inherit System.Object
val someField : string val someField : string
skipping to change at line 947 skipping to change at line 947
new(s:string) = { inherit System.Attribute(); v=s } new(s:string) = { inherit System.Attribute(); v=s }
end end
// BUG: // BUG:
type [<DontPressThisButton("Please don't press this again")>] button = Buttpon type [<DontPressThisButton("Please don't press this again")>] button = Buttpon
let [<DontPressThisButton("Please don't press this again")>] button () = 1 let [<DontPressThisButton("Please don't press this again")>] button () = 1
//--------------------------------------------------------------------- //---------------------------------------------------------------------
// Test we can use base calls // Test we can use base calls
#if !FX_PORTABLE_OR_NETSTANDARD #if !NETCOREAPP1_0
open System.Windows.Forms open System.Windows.Forms
type MyCanvas2 = type MyCanvas2 =
class class
inherit Form inherit Form
override x.OnPaint(args) = Printf.printf "OnPaint\n"; base.OnPaint(args) override x.OnPaint(args) = Printf.printf "OnPaint\n"; base.OnPaint(args)
new() = { inherit Form(); } new() = { inherit Form(); }
end end
skipping to change at line 1715 skipping to change at line 1715
let a = Cab( {a="hello"; b="world";} ) let a = Cab( {a="hello"; b="world";} )
end end
module DefaultConstructorConstraints = begin module DefaultConstructorConstraints = begin
let f1 () : 'a when 'a : (new : unit -> 'a) = new 'a() let f1 () : 'a when 'a : (new : unit -> 'a) = new 'a()
let x1 = (f1() : obj) let x1 = (f1() : obj)
let x2 = (f1() : int) let x2 = (f1() : int)
let x3 = (f1() : DateTime) let x3 = (f1() : DateTime)
#if !FX_PORTABLE_OR_NETSTANDARD #if !NETCOREAPP1_0
let x4 = (f1() : System.Windows.Forms.Form) let x4 = (f1() : System.Windows.Forms.Form)
#endif #endif
let f2 () = f1() let f2 () = f1()
let y1 = (f2() : obj) let y1 = (f2() : obj)
let y2 = (f2() : int) let y2 = (f2() : int)
let y3 = (f2() : DateTime) let y3 = (f2() : DateTime)
#if !FX_PORTABLE_OR_NETSTANDARD #if !NETCOREAPP1_0
let y4 = (f2() : System.Windows.Forms.Form) let y4 = (f2() : System.Windows.Forms.Form)
#endif #endif
end end
module AccessBugOnFSharpList = begin module AccessBugOnFSharpList = begin
open System.Web open System.Web
open System.Web.Hosting open System.Web.Hosting
open System.Data.SqlClient open System.Data.SqlClient
skipping to change at line 1958 skipping to change at line 1958
module T1 = module T1 =
type Vector2D(dx: float, dy: float) = type Vector2D(dx: float, dy: float) =
let len = sqrt(dx * dx + dy * dy) let len = sqrt(dx * dx + dy * dy)
member v.DX = dx member v.DX = dx
member v.DY = dy member v.DY = dy
member v.Length = len member v.Length = len
Vector2D(1.0,1.0) = Vector2D(1.0,1.0) Vector2D(1.0,1.0) = Vector2D(1.0,1.0)
#if !FX_PORTABLE_OR_NETSTANDARD #if !NETCOREAPP1_0
module Ex5 = module Ex5 =
open System.Drawing open System.Drawing
type Label(?text,?font) = type Label(?text,?font) =
let text = match text with None -> "" | Some v -> v let text = match text with None -> "" | Some v -> v
let font = match font with None -> new Font(FontFamily.GenericSansSerif, 12.0f) | Some v -> v let font = match font with None -> new Font(FontFamily.GenericSansSerif, 12.0f) | Some v -> v
member x.Text = text member x.Text = text
member x.Font = font member x.Font = font
Label(text="Hello World") Label(text="Hello World")
Label(font=new Font(FontFamily.GenericMonospace,36.0f), Label(font=new Font(FontFamily.GenericMonospace,36.0f),
skipping to change at line 5388 skipping to change at line 5388
let test3e () = let test3e () =
let count = ref 0 let count = ref 0
let rec f (x: 'T) = let rec f (x: 'T) =
incr count; incr count;
if !count > 4 then if !count > 4 then
1 1
else else
g "1" |> ignore; // note, use of non-generic 'g' within a ge neric, generalized memoized function g "1" |> ignore; // note, use of non-generic 'g' within a ge neric, generalized memoized function
2 2
and g : string -> int = memoize f // note, computed function value using generic f at an instance and g : string -> int = memoize f // note, computed function value using generic �f� at an instance
g "1" g "1"
let res = test3e() let res = test3e()
check "fe09ekn" res 2 check "fe09ekn" res 2
printfn "test passed ok without NullReferenceException" printfn "test passed ok without NullReferenceException"
module Devdiv2_5385_repro2 = module Devdiv2_5385_repro2 =
 End of changes. 7 change blocks. 
7 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)