AFAIK, "this" won't be valid until the constructor completes. So instead of j = this.dup() you want j = base.dup(). That works in 1.9.6.16 anyways.

By on 9/8/2009 5:35 AM ()

Hmmm,

So I can call a method of a super class via base
but cannot access a field of a super class via base?

// This works.
type SubBase =
inherit Base
val j: int
new (x) as this = { inherit Base(x); j = base.dup () };;

// This does compile.
type SubBase2 =
inherit Base
val j: int
new (x) as this = { inherit Base(x); j = base.i };;

By on 9/8/2009 5:55 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper