I have this class:
type Sample() =
member val test1 = "" with get,set
member val test2 = "" with get,set
// is something like the below constructor possible
new Sample(result1, result2) =
this.test1 <- "failed"
this.test2 <- "passed"
Sample()
I've tried several different ways, but I can not get it to work.
Is this what you want?
type Sample(result1, result2) =
member val Test1 = result1 with get,set
member val Test2 = result2 with get,set
new () = Sample("failed", "passed")
FSI:
> Sample();;
val it : Sample = FSI_0002+Sample {Test1 = "failed";
Test2 = "passed";}
> Sample("foo", "bar");;
val it : Sample = FSI_0002+Sample {Test1 = "foo";
Test2 = "bar";}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With