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

Add nullability matchers with Kotlin Contracts (#602) #646

Merged
merged 1 commit into from
Feb 11, 2019

Conversation

LeoColman
Copy link
Member

Bringing it from parallel branch

With Kotlin Contracts it's possible to establish that "If this function passes, X is true". This commit implements nullability type matchers for the Any? type, using Contracts to allow non-null inference to users.

This commit didn't implement the same logic for matchers such as x.shouldBeInstanceOf<Foo>(), because currently it's impossible to implement this with Kotlin Contracts. https://youtrack.jetbrains.com/issue/KT-28298

Fixes #601

With Kotlin Contracts it's possible to establish that "If this function passes, X is true". This commit implements nullability type matchers for the `Any?` type, using Contracts to allow non-null inference to users.

This commit didn't implement the same logic for matchers such as `x.shouldBeInstanceOf<Foo>()`, because currently it's impossible to implement this with Kotlin Contracts. https://youtrack.jetbrains.com/issue/KT-28298

Fixes #601
@LeoColman LeoColman merged commit 3e1eba5 into master Feb 11, 2019
@LeoColman LeoColman deleted the release/3.3.0 branch February 11, 2019 11:20
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.

1 participant