Skip to content

Adding contracts for Anycol.isValueColumn etc. for smart-casting #882

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

Merged
merged 2 commits into from
Sep 24, 2024

Conversation

Jolanrensen
Copy link
Collaborator

Small change to reduce verbose code like:

if (col.isColumnGroup()) callFunction(col.asColumnGroup())

to

if (col.isColumnGroup()) callFunction(col)

thanks to contracts :).

Unfortunately, we cannot yet do this with enum entries, so when we're using notations like

when (col.kind) {
    ColumnKind.Group -> callFunction(col.asColumnGroup())
    ....
}

are still necessary.

@Jolanrensen Jolanrensen added the infrastructure GitHub actions, Gradle Scripts, Writerside, etc. label Sep 24, 2024
@Jolanrensen Jolanrensen added this to the 0.15.0 milestone Sep 24, 2024
Copy link
Contributor

Generated sources will be updated after merging this PR.
Please inspect the changes in here.

Copy link
Collaborator

@koperagen koperagen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool!

@Jolanrensen Jolanrensen merged commit 976d4d7 into master Sep 24, 2024
5 of 6 checks passed
@Jolanrensen Jolanrensen deleted the contracts branch September 24, 2024 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure GitHub actions, Gradle Scripts, Writerside, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants