File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
compiler/src/dotty/tools/dotc/transform/init Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -1179,6 +1179,7 @@ object Objects:
1179
1179
if sym.is(Flags .Package ) then
1180
1180
Bottom
1181
1181
else if sym.isStaticObject && sym != klass then
1182
+ // The typer may use ThisType to refer to an object outside its definition.
1182
1183
if elideObjectAccess then
1183
1184
ObjectRef (sym.moduleClass.asClass)
1184
1185
else
@@ -1404,15 +1405,15 @@ object Objects:
1404
1405
def errorMutateOtherStaticObject (currentObj : ClassSymbol , otherObj : ClassSymbol )(using Trace , Context ) =
1405
1406
val msg =
1406
1407
s " Mutating ${otherObj.show} during initialization of ${currentObj.show}. \n " +
1407
- " Mutating other static objects during the initialization of one static object is discouraged . " +
1408
+ " Mutating other static objects during the initialization of one static object is forbidden . " +
1408
1409
" Calling trace:\n " + Trace .show
1409
1410
1410
1411
report.warning(msg, Trace .position)
1411
1412
1412
1413
def errorReadOtherStaticObject (currentObj : ClassSymbol , otherObj : ClassSymbol )(using Trace , Context ) =
1413
1414
val msg =
1414
1415
" Reading mutable state of " + otherObj.show + " during initialization of " + currentObj.show + " .\n " +
1415
- " Reading mutable state of other static objects is discouraged as it breaks initialization-time irrelevance. " +
1416
+ " Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. " +
1416
1417
" Calling trace: " + Trace .show
1417
1418
1418
1419
report.warning(msg, Trace .position)
You can’t perform that action at this time.
0 commit comments