File tree 1 file changed +5
-3
lines changed
compiler/src/dotty/tools/dotc/transform/init
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -263,6 +263,8 @@ class Objects {
263
263
264
264
case ClassAbs (klass) =>
265
265
val target = if needResolve then resolve(klass, field) else field
266
+ if ! target.hasSource then return Result (Bottom , Nil )
267
+
266
268
val trace1 = trace.add(source)
267
269
if target.is(Flags .Lazy ) then
268
270
given Trace = trace1
@@ -274,6 +276,8 @@ class Objects {
274
276
275
277
case addr : Addr =>
276
278
val target = if needResolve then resolve(addr.klass, field) else field
279
+ if ! target.hasSource then return Result (Bottom , Nil )
280
+
277
281
val trace1 = trace.add(source)
278
282
if target.is(Flags .Lazy ) then
279
283
given Trace = trace1
@@ -290,11 +294,9 @@ class Objects {
290
294
//
291
295
// return `Bottom` here, errors are reported in checking `ThisRef`
292
296
Result (Bottom , Nil )
293
- else if target.hasSource then
297
+ else
294
298
val rhs = target.defTree.asInstanceOf [ValOrDefDef ].rhs
295
299
eval(rhs, addr, target.owner.asClass, cacheResult = true )
296
- else
297
- Result (Bottom , Nil )
298
300
299
301
case _ : Fun =>
300
302
???
You can’t perform that action at this time.
0 commit comments