Configure IntelliJ to respect @LateInit annotations (#1606)

IntelliJ can understand that some annotations on fields mean that they
are implicitly initialized, which means we don't get the "field XXX is
not initialized" warning for `@LateInit` fields.

This setting, unfortunately, is recorded into `.idea/misc.xml`, which
contains a bunch of arbitrary stuff that we don't want to check into
source control

This adds some logic to touch up that file to mark `@LateInit` as
implicitly initialized fields, so we don't get any editor warnings.

Also, suppress some warnings.
This commit is contained in:
Daniel Chao
2026-05-21 14:34:11 -07:00
committed by GitHub
parent 3dc93cbd4a
commit 87ea28260b
3 changed files with 82 additions and 0 deletions
@@ -47,6 +47,7 @@ public final class TypeAlias extends Member implements Value {
}
public void initAliasedType(PType type) {
//noinspection ConstantValue
assert aliasedType == null;
aliasedType = type;
}
@@ -80,6 +81,7 @@ public final class TypeAlias extends Member implements Value {
/** Returns the type that this type alias stands for. */
public PType getAliasedType() {
//noinspection ConstantValue
assert aliasedType != null;
return aliasedType;
}