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

[2/x] Remove Obj-C based nil check #272

Merged
merged 1 commit into from
Jan 19, 2022

Conversation

andrewchang-bird
Copy link
Contributor

@andrewchang-bird andrewchang-bird commented Jan 19, 2022

Stack

πŸ“š #275 [5/x] Clean up Synchronized wrapper
πŸ“š #274 [4/x] Fix nested optional property and Obj-C types
πŸ“š #273 [3/x] Improve compile-time checks for Swift mocks
πŸ“š #272 ← [2/x] Remove Obj-C based nil check
πŸ“š #271 [1/x] Add Algolia DocSearch to the documentation

Overview

Removes the MKBCheckIfTypeErasedNil workaround in favor of a simple protocol extension on Optional.

Test Plan

func test<T>(_ value: T) -> Bool {
  return (value as? Nullable)?.isNil ?? false
}
test(Optional<Int>(nil))  // true
test(Optional<Int>(42))   // false
test(42)   // false

Base automatically changed from dev/andrewchang-bird/add-algolia-search to master January 19, 2022 18:52
@andrewchang-bird andrewchang-bird force-pushed the dev/andrewchang-bird/remove-objc-nilcheck branch from d1cd576 to 5dea192 Compare January 19, 2022 18:54
@andrewchang-bird andrewchang-bird merged commit d05e8c8 into master Jan 19, 2022
@andrewchang-bird andrewchang-bird deleted the dev/andrewchang-bird/remove-objc-nilcheck branch January 19, 2022 19:43
andrewchang-bird added a commit that referenced this pull request Jan 19, 2022
## Overview

Removes the `MKBCheckIfTypeErasedNil` workaround in favor of a simple
protocol extension on `Optional`.

## Test Plan

```swift
func test<T>(_ value: T) -> Bool {
  return (value as? Nullable)?.isNil ?? false
}
test(Optional<Int>(nil))  // true
test(Optional<Int>(42))   // false
test(42)   // false
```
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.

None yet

2 participants