pinterest / ktlint

An anti-bikeshedding Kotlin linter with built-in formatter
https://pinterest.github.io/ktlint/
MIT License
6.06k stars 504 forks source link

No args constructor can be improperly removed #2706

Closed rsmith20 closed 1 week ago

rsmith20 commented 1 week ago

Expected Behavior

The noargs constructor should not be removed:

class Foo() {
    constructor(x: Int) : this()
}

Observed Behavior

The constructor is removed:

class Foo {
    constructor(x: Int) : this()
}

Steps to Reproduce

Using class

class Foo() {
    constructor(x: Int) : this()
}

format with Intellij plugin 0.23.0 or command line ktlint 1.3.0.

Your Environment

paul-dingemans commented 1 week ago

Duplicate #2690. Tnx for reporting though.