I believe it works if you add oclAsType:
[let ac : AssociationClass = c.oclAsType(AssociationClass) ]
Thanks for the tip,
this syntax doesn't complains at build time but at runtime, there is a
java exception from org.eclipse.acceleo.engine if "c" isn't an
"AssociationClass" instance