This one is probably really stupid. How do you check the subclass of an object in Chapel?
class Banana : Fruit {
var color: string;
}
class Apple: Fruit {
var poison: bool;
}
class Fruit {
}
var a = new Apple(poison=true);
var b = new Banana(color="green");
// ?, kinda Java-ish, what should I do?
if (type(a) == Apple.class()) {
writeln("Go away doctor!");
}
Though I'm asking about a subclass, I realize I don't know how to check if it's a Fruit
class either.