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

Don't deprecate non-smart-cast-based version of shouldBeInstanceOf #3843

Closed
languitar opened this issue Jan 22, 2024 · 1 comment
Closed
Labels
assertions 🔍 Related to the assertion mechanisms within the testing framework. enhancement ✨ Suggestions for adding new features or improving existing ones.

Comments

@languitar
Copy link

languitar commented Jan 22, 2024

Version of shouldBeInstanceOf etc. accepting a block of code as argument are marked for deprecation. However, smart casts are not always usable across module boundaries (https://discuss.kotlinlang.org/t/what-is-the-reason-behind-smart-cast-being-impossible-to-perform-when-referenced-class-is-in-another-module/2201/2). Therefore, I sometimes have to resort to the deprecated versions accepting a block to avoid a compiler error. Therefore, these methods should not be deprecated.

@languitar languitar changed the title Don't deprecate non-smart-contract-based version of shouldBeInstanceOf Don't deprecate non-smart-cast-based version of shouldBeInstanceOf Jan 22, 2024
@LeoColman LeoColman added enhancement ✨ Suggestions for adding new features or improving existing ones. assertions 🔍 Related to the assertion mechanisms within the testing framework. labels Jan 25, 2024
@sksamuel
Copy link
Member

Good observation thanks. Undeprecated in 5.8.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assertions 🔍 Related to the assertion mechanisms within the testing framework. enhancement ✨ Suggestions for adding new features or improving existing ones.
Projects
None yet
Development

No branches or pull requests

3 participants