After some trial and error and looking at the error messages, I came up with the following:
import org.sonar.api.batch._ import org.sonar.api.resources._ object D { type R = Resource[T] forSome {type T <: Resource[_ <: AnyRef]} type S[T] = Resource[T] forSome {type T <: Resource[_ <: AnyRef]} } class D extends Decorator { def decorate(r: DR, context: DecoratorContext) {}
I am not sure if this will allow you to realize what you need. I looked at Resource , and it can represent a File
that extends Resource<Directory>
or is sometimes a raw? Type that just extends Resource
like for Directory
.
Edit: after thinking about it, you can remove forSome
- this also compiles:
def decorate(resource: Resource[_ <: Resource[_ <: AnyRef]], context: DecoratorContext) { }
source share