I have a method with signature:
func relatedObject<T: SomeType>(for type: T.Type) -> SomeRelatedObject
I have a SomeType.Type
variable, and I want to call the method somehow, like:
let typeVariable: SomeType.Type = ...
let result = relatedObject(for: typeVariable)
but I get an error:
Cannot invoke 'relatedObject' with an argument list of type '(for: SomeType.Type)'
Is it possible to actually invoke the method somehow having a type variable?