You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
are not compiling because Item type was taken from method's generic requirements.
Sourcery should be able to recognize if the type is generic and use facilities provided along Type.swift, that is, isGeneric and genericRequirements to correctly substitute such types using either Any or, preferably type.typeName.actualTypeName which would include protocol composition or a single protocol type.
The feature to support methods with generic requirements is something totally new to Sourcery, and was never working 100%.
In fact, this issue is much less of a bug than actually being a feature request.
To implement this, it is a matter of adjusting AutoMockable.stencil file, and it should work.
If you are using your own template, for example, you should be able to get if the type is a generic requirement of a method or not, from Method type, which is also something very new.
Hope this helps! 👍🏻
I would be able to implement this myself by the end of April, currently being busy with other stuff 🧑🏭
Given
When I run Sourcery
Then I see the output:
Context
Here, lines
are not compiling because
Item
type was taken from method's generic requirements.Sourcery should be able to recognize if the type is
generic
and use facilities provided alongType.swift
, that is,isGeneric
andgenericRequirements
to correctly substitute such types using eitherAny
or, preferablytype.typeName.actualTypeName
which would include protocol composition or a single protocol type.Related to: #1284 and #1029
The text was updated successfully, but these errors were encountered: