@@ -50,6 +50,11 @@ public final class BAnyType extends BSemTypeWrapper<BAnyType.BAnyTypeImpl> imple
5050 public BAnyType (String typeName , Module pkg , boolean readonly ) {
5151 super (new ConcurrentLazySupplier <>(() -> new BAnyTypeImpl (typeName , pkg , readonly )),
5252 typeName , pkg , TypeTags .ANY_TAG , pickSemType (readonly ));
53+ if (!readonly ) {
54+ BAnyType immutableAnyType = new BAnyType (TypeConstants .READONLY_ANY_TNAME , pkg , true );
55+ this .getbType ().immutableType = new BIntersectionType (pkg , new Type []{this , PredefinedTypes .TYPE_READONLY },
56+ immutableAnyType , TypeFlags .asMask (TypeFlags .NILABLE ), true );
57+ }
5358 }
5459
5560 @ Override
@@ -91,12 +96,6 @@ protected static final class BAnyTypeImpl extends BType implements AnyType {
9196 private BAnyTypeImpl (String typeName , Module pkg , boolean readonly ) {
9297 super (typeName , pkg , RefValue .class , false );
9398 this .readonly = readonly ;
94-
95- if (!readonly ) {
96- BAnyType immutableAnyType = new BAnyType (TypeConstants .READONLY_ANY_TNAME , pkg , true );
97- this .immutableType = new BIntersectionType (pkg , new Type []{this , PredefinedTypes .TYPE_READONLY },
98- immutableAnyType , TypeFlags .asMask (TypeFlags .NILABLE ), true );
99- }
10099 }
101100
102101 @ Override
0 commit comments