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

Use checkTarget on modifiers #961

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Use checkTarget on modifiers #961

wants to merge 2 commits into from

Conversation

GlassBricks
Copy link
Contributor

This probably needs proofreading.

Other comments:

  • Parameters can have some modifiers that properties can (that they otherwise shouldn't); this is to keep consistent behavior when parameters are turned into primary constructor properties.
    • A test case was found that doesn't produce compiling code (final does not apply to non-property parameter). This is fixed in a separate commit.
  • In/Out (type variable) modifiers already have their own check.
  • The Reified KModifier isn't used at all. See add doc about reified keyword #939

Benjamin Ye added 2 commits August 2, 2020 10:15
This does not cover all combinations of modifiers.

In/Out modifiers have their own target check.

Some property modifiers are applied to parameters because they can be used as constructor properties (?)
Kotlin parameters are always final, and cannot have a `final` modifier.

Final is still allowed on parameters because they can be used as constructor properties.
@@ -124,11 +124,7 @@ public class TypeAliasSpec private constructor(
addAnnotation(annotation.asClassName())

public fun build(): TypeAliasSpec {
for (it in modifiers) {
require(it in ALLOWABLE_MODIFIERS) {
Copy link
Member

Choose a reason for hiding this comment

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

This variable now unused?

@Egorand Egorand changed the base branch from master to main July 5, 2023 09:22
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