Overriding and generating constructors in Kotlin

Answered

Why there is no selection to generate constructor of super class? ViewGroup has other 3 constructor:

```

public ViewGroup(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}

public ViewGroup(Context context, AttributeSet attrs, int defStyleAttr) {
this(context, attrs, defStyleAttr, 0);
}

public ViewGroup(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);

initViewGroup();
initFromAttributes(context, attrs, defStyleAttr, defStyleRes);
}

```

0
6 comments

Wonder why on IDE forum there is no code formatting option

0

Please use https://discuss.kotlinlang.org/ for any questions related to Kotlin, it supports the code formatting as well.

0

But that's not about Kotlin code formatting, it's about behaviour of IDE. For the same Java class IDE allows to generate constructor:

I'm trying to understand whether is a bug or by some reason Intellij Ultimate doesn't support Kotlin constructors generation.

0

It's a feature of the Kotlin IDE plug-in, so it belongs to Kotlin forum.

0

> But that's not about Kotlin code formatting

My comment was about code formatting in the forum, not in the IDE.

0

Please sign in to leave a comment.