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

Publish lint rules and/or IDE hints #40

Open
drewhamilton opened this issue Mar 11, 2021 · 1 comment
Open

Publish lint rules and/or IDE hints #40

drewhamilton opened this issue Mar 11, 2021 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@drewhamilton
Copy link
Owner

Ideally not Android-specific. Make the IDE tell developers what things are disallowed and/or discouraged, like no primary constructor and array properties. Mimic existing data class hints.

@drewhamilton drewhamilton added enhancement New feature or request help wanted Extra attention is needed labels Mar 11, 2021
@drewhamilton
Copy link
Owner Author

K2 + FIR might make this considerably easier

drewhamilton added a commit that referenced this issue Sep 6, 2023
It is backed by an Int whose hashCode is the identity function.

Before:

    public int hashCode();
      Code:
         0: aload_0
         1: getfield      #13                 // Field uint:I
         4: invokestatic  #35                 // Method kotlin/UInt."hashCode-impl":(I)I
         7: istore_1
         8: iload_1
         9: bipush        31
        11: imul
        12: aload_0
        13: getfield      #17                 // Field long:J
        16: invokestatic  #40                 // Method java/lang/Long.hashCode:(J)I
        19: iadd
        20: istore_1
        21: iload_1
        22: ireturn

After:

    public int hashCode();
      Code:
         0: aload_0
         1: getfield      #13                 // Field uint:I
         4: istore_1
         5: iload_1
         6: bipush        31
         8: imul
         9: aload_0
        10: getfield      #17                 // Field long:J
        13: invokestatic  #34                 // Method java/lang/Long.hashCode:(J)I
        16: iadd
        17: istore_1
        18: iload_1
        19: ireturn

---------

Co-authored-by: Drew Hamilton <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant