if (e != null) {
ProducedType ot = unit.getType(unit.getObtainableDeclaration());
ProducedType dt = unit.getType(unit.getDestroyableDeclaration());
if (isInstantiationExpression(e)) {
if (!t.isSubtypeOf(dt) && !t.isSubtypeOf(ot)) {
typedNode.addError("resource must be either obtainable or destroyable: '" +
t.getProducedTypeName(unit) + "' is neither 'Obtainable' nor 'Destroyable'");
}
}
else {
checkAssignable(t, ot, typedNode, "resource must be obtainable");