I have this

```
import std.stdio : writeln;

abstract class Foo { }

class Bar : Foo
{
    float value;

    this(float t_value) { value = t_value; }
}

class Baz : Foo
{
    string name;

    this(string t_name) { name = t_name; }
}

void main()
{
    Foo foo = new Bar(10);

    if (/* typeof foo == Bar */)
        foo.value.writeln;
    else if (/* typeof foo == Baz */)
        foo.name.writeln;

    foo.writeln;
}
```

I don't understand how i can differentiate between Bar and Baz and to get their attributes

Reply via email to