Skip to content
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

Respect event type nullability #931

Merged
merged 1 commit into from
Apr 19, 2023
Merged

Conversation

JakeWharton
Copy link
Collaborator

If an event is declared as non-nullable then it is required and non-null. If an event is declared as nullable then it is still required but can be set to null. And, of course, nullable event can have a default of null.

This brings it directly in line with property behavior. I'm not sure why we had the weird nullability behavior from before.

Closes #921

If an event is declared as non-nullable then it is required and non-null. If an event is declared as nullable then it is still required but can be set to null. And, of course, nullable event can have a default of null.

This brings it directly in line with property behavior. I'm not sure why we had the weird nullability behavior from before.
@JakeWharton JakeWharton force-pushed the jw.event-nullability.2023-04-18 branch from cc68d51 to 619ec8f Compare April 19, 2023 01:07
@JakeWharton JakeWharton enabled auto-merge (squash) April 19, 2023 01:09
@JakeWharton JakeWharton merged commit af1d9f5 into trunk Apr 19, 2023
@JakeWharton JakeWharton deleted the jw.event-nullability.2023-04-18 branch April 19, 2023 01:43
colinrtwhite added a commit that referenced this pull request Apr 19, 2023
* trunk:
  Ensure children lambda type returns Unit (#932)
  Respect event type nullability (#931)
  Update kotlin monorepo to v1.8.20 (#889)
  No default for embedded Zipline code (#926)
  Annotate schema properties, not parameters (#924)
  Propagate network failures in Emoji Search (#927)
  Cancel HTTP call on coroutine cancellation in Emoji Search (#928)
  Remove empty lambda from jvm target declaration (#925)
  Add LazyListScope#itemsIndexed (#917)
  Parse and generate deprecations from the schema (#922)
  Add LazyListScope#items(Array<T>, …) and LazyListScope#itemsIndexed(Array<T>, …) (#918)
  Add LazyListScope#item (#916)
  Expose the host's safe area insets in HostConfiguration. (#913)
  Move LazyListScope to LazyDsl.kt (#915)
  Update jbCompose to v1.4.0 (#904)
  Update dependency com.vanniktech:gradle-maven-publish-plugin to v0.25.2 (#914)
  Update dependency com.android.tools.lint:lint to v31 (#911)
  Build treehouse-lazylayout-compose on all platforms (#909)
  Add instructions for building the Counter app for iOS/Android. (#906)
colinrtwhite added a commit that referenced this pull request Apr 19, 2023
* trunk:
  Ensure children lambda type returns Unit (#932)
  Respect event type nullability (#931)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Widget event lambda should not be always nullable
2 participants