Generics 扩展特征不匹配的Groovy泛型类型-不是有界参数的有效替代品

Generics 扩展特征不匹配的Groovy泛型类型-不是有界参数的有效替代品,generics,groovy,traits,Generics,Groovy,Traits,下面的代码不是在Groovy 3.0.4中编译的(尽管在Groovy 2.5.0及以下版本中很好) Factory f=新工厂(); 性状碱基{} 类SomeImpl实现基{} 类工厂{} 我得到的确切错误是: The type SomeImpl is not a valid substitute for the bounded parameter <T extends Base> @ line 1, column 9. Factory<SomeImpl> f = ne

下面的代码不是在Groovy 3.0.4中编译的(尽管在Groovy 2.5.0及以下版本中很好)

Factory f=新工厂();
性状碱基{}
类SomeImpl实现基{}
类工厂{}
我得到的确切错误是:

The type SomeImpl is not a valid substitute for the bounded parameter <T extends Base> @ line 1, column 9.
Factory<SomeImpl> f = new Factory<>();
类型SomeImpl不是第1行第9列的有界参数的有效替代品。
工厂f=新工厂();
Basetrait更改为interface可以按预期编译代码,并且可以正常工作(就像在Java中一样)

trait是否与不允许我们进行此类构造的接口有所不同?或者它是最近groovy版本中的一个bug

The type SomeImpl is not a valid substitute for the bounded parameter <T extends Base> @ line 1, column 9.
Factory<SomeImpl> f = new Factory<>();