Groovy 不要求所有的允许类都应在编译时可用并与基类一起编译。 编译器不会在处理非扩展允许子类时警告用户,但这与 sealed 类的性质相矛盾。
示例:
class A permits B {} // 报告 B class B {}