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
After updating Sourcery to new version, I found that one of my template is failing
I found commit which broke it: 7153768#1345
Part of the template: {% for decodeType in types.all where decodeType.directory|contains:argument.targetName and (decodeType.kind == "struct" or decodeType.kind == "class") and (decodeType|based:"Codable" or decodeType|based:"Decodable" ) and decodeType.annotations.DISABLED_FAILED_TESTS == nil %}
As I understand the problem, @art-divin you added new type 'Any', but which does not support some properties, like directory which is nil and filtering of nil throws the error: decodeType.directory|contains:argument.targetName
I don't know if it's really issue or WAD, anyway my local fix is to check kind for 'struct+class' earlier than directory, but maybe we should have some guards, e.g. resolving filter of nil should return nil earlier without deep diving and throwing the error
as you see, result is already nil, I don't see any reasons trying to filter it
WDYT about it
The text was updated successfully, but these errors were encountered:
After updating Sourcery to new version, I found that one of my template is failing
I found commit which broke it: 7153768 #1345
Part of the template:
{% for decodeType in types.all where decodeType.directory|contains:argument.targetName and (decodeType.kind == "struct" or decodeType.kind == "class") and (decodeType|based:"Codable" or decodeType|based:"Decodable" ) and decodeType.annotations.DISABLED_FAILED_TESTS == nil %}
As I understand the problem, @art-divin you added new type 'Any', but which does not support some properties, like directory which is nil and filtering of nil throws the error:
decodeType.directory|contains:argument.targetName
I don't know if it's really issue or WAD, anyway my local fix is to check kind for 'struct+class' earlier than directory, but maybe we should have some guards, e.g. resolving filter of nil should return nil earlier without deep diving and throwing the error
as you see, result is already nil, I don't see any reasons trying to filter it
WDYT about it
The text was updated successfully, but these errors were encountered: