Closed Bencodes closed 4 days ago
KtLint should retain the top level constructor () when an overloaded constructor exists and calls this()
()
this()
KtLint removes the default empty class level constructor when a secondary overloaded constructor exists.
Given:
class Foo() { constructor(foo: String) : this() { // N/A } }
KtLint produces the following Kotlin class where the default class level constructor is removed which breaks the overloaded constructors ability to call this()
class Foo { constructor(foo: String) : this() { // N/A } }
.editorconfig
Nice find. An empty VALUE_PARAMETER_LIST should only be disallowed in case the class does not contain a secondary constructor.
Expected Behavior
KtLint should retain the top level constructor
()
when an overloaded constructor exists and callsthis()
Observed Behavior
KtLint removes the default empty class level constructor when a secondary overloaded constructor exists.
Steps to Reproduce
Given:
KtLint produces the following Kotlin class where the default class level constructor is removed which breaks the overloaded constructors ability to call
this()
Your Environment
.editorconfig
settings: I'm able to reproduce with an empty editor config.