Post

Replies

Boosts

Views

Activity

Comment on Swift inconsistent warning: Result of call to 'xxx' is unused, where xxx is a function returning Void
It's both. Note that this CachedObject class is an abstract class. My instances are subclasses of CachedObject, and that's why the handler has an argument of type Self, and not a static type. If I ignore the warning, everything is fine (just an inconsistent warning). If I want to discard the warning, which I did with Swift 4, I need to do "_ = object.reload()", but since Swift 5, it generates a compiler error.
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’22