fsprojects / FSharp.Compiler.PortaCode

The PortaCode F# code format and corresponding interpreter. Used by Fabulous and others.
Other
42 stars 11 forks source link

Interpreted classes can't inherit from abstract classes #22

Closed dsyme closed 3 years ago

dsyme commented 3 years ago

If an interpreted type inherits from a compiled type you can't create an instance of that type

'Cannot create an instance of DiffSharp.Model.Model because it is an abstract class.'

This is because the interpreter doesn't have a "real" class for the interpreted type and instead tries to use delegation to the inherited object.

Only current workaround is to modify code to inherit from a non-abstract type

dsyme commented 3 years ago

This is fixed by implementing shell types in #25