Skip to content

Commit 3cadb59

Browse files
committed
Fix #4318: Ignore java.lang.Object companion object
java.lang.Object companion object does not exist but has a companion object. We used to record a dependency on it for incremental compilation when `java.lang.Object` was imported.
1 parent ab02870 commit 3cadb59

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

.drone.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ pipeline:
5656
commands:
5757
- cp -R . /tmp/5/ && cd /tmp/5/
5858
- ./project/scripts/sbt sbt-dotty/scripted
59-
when:
60-
# sbt scripted tests are slow and only run on nightly or deployment
61-
event: [ tag, deployment ]
59+
# when:
60+
# # sbt scripted tests are slow and only run on nightly or deployment
61+
# event: [ tag, deployment ]
6262

6363
# DOCUMENTATION:
6464
documentation:

compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ private class ExtractDependenciesCollector extends tpd.TreeTraverser { thisTreeT
313313

314314
private def ignoreDependency(sym: Symbol)(implicit ctx: Context) =
315315
!sym.exists ||
316+
sym.unforcedIsAbsent || // ignore java.lang.Object companion object
316317
sym.is(PackageClass) ||
317318
sym.isEffectiveRoot ||
318319
sym.isAnonymousFunction ||

tests/pos/i4318.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import java.lang.Object

0 commit comments

Comments
 (0)