Fixed
Status Update
Comments
da...@google.com <da...@google.com> #2
Thanks -- I'll add it on my plate to take a look.
What's strange is the code definitely sets the constructor to private:
@NotNull
private PsiMethod createConstructor() {
LightMethodBuilder constructor = new LightMethodBuilder(this, JavaLanguage.INSTANCE);
constructor.setConstructor(true);
constructor.addModifier("private");
return constructor;
}
but I'll see if I can repro and then observe in a debugger.
da...@google.com <da...@google.com> #3
We figured it out. Fix should land in 4.0 canary 9.
Thanks for the report!
Description
1. Have a layout file e.g. layout/layout.xml with view binding enabled
2. Type the following in a Kotlin file in Android Studio:
val binding: LayoutBinding = LayoutBinding
3. At the end of the line, perform an auto-complete. AS will suggest to complete (among other things) as LayoutBinding()
This appears to work (no errors visible in the editor) but will fail to compile, saying the constructor is private (as it should). Expected is that AS would not suggest the constructor invocation completion and that it would mark it as an error if manually typed.