DMD OSX / Segfault 11

Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Feb 2 10:59:35 PST 2016


On 2/2/16 1:06 PM, Robert M. Münch wrote:
> I have a very strange effect, I'm not sure what it is about:
>
> Value: {}
>
> WordV: Value {
>      Value* get() {}
> }
>
> BaseOperator: Value : {
> }
>
>
> Now comes the code using this:
>
> auto op = cast(BaseOperator)(Word.get());
> if (op !is null) {...
>
>
> If get() returns "Value*" it segfaults, if I change it to "Value" it
> works. How can this be?
>
> I want to check of the Value returned from get() is a BaseOperator or not.
>

If this is valid D, I'm not sure what it means :)

-Steve


More information about the Digitalmars-d-learn mailing list