-
Notifications
You must be signed in to change notification settings - Fork 429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warning for observation APIs when used with inhabitable types & promoteValue
.
#429
Conversation
promoteValue
.
Signal<Never, NoError>.never.flatMapError { _ in SignalProducer<Never, AnyError>.empty } | ||
Signal<Never, NoError>.never.flatMapError { _ in SignalProducer<Never, NoError>.empty } | ||
} | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a bunch of test cases to verify these combinations would emit the error message. Moving them to the spec would flood the IDE with warnings, so I just commented them out. 🤦♂️
Just needs a changelog entry or two. |
I think it needs better error message to tell that ignoring the error message would trap at runtime & also fill in the blanks for |
@mdiep Please check. The error message are written in reduced written register btw, following the swift stdlib style. |
Raise warnings when using observation API or operators that is essentially a logic error due to
Value
orError
being an inhabitable type. Please refer toInhabitableTypeGuards.swift
for the lists of affected operators.Also note that these overloads cannot be marked as
unavailable
orobsolete
, or otherwise the regular version would take precedence over this.Checklist