File tree Expand file tree Collapse file tree 10 files changed +51
-3
lines changed
compiler/src/dotty/tools/dotc
sbt-test/source-dependencies/macro-expansion-dependencies-4 Expand file tree Collapse file tree 10 files changed +51
-3
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,6 @@ class Compiler {
3535 List (new TyperPhase ) :: // Compiler frontend: namer, typer
3636 List (CheckUnused .PostTyper (), CheckShadowing ()) :: // Check for unused, shadowed elements
3737 List (new YCheckPositions ) :: // YCheck positions
38- List (new sbt.ExtractDependencies ) :: // Sends information on classes' dependencies to sbt via callbacks
3938 List (new semanticdb.ExtractSemanticDB .ExtractSemanticInfo ) :: // Extract info into .semanticdb files
4039 List (new PostTyper ) :: // Additional checks and cleanups after type checking
4140 List (new UnrollDefinitions ) :: // Unroll annotated methods if detected in PostTyper
@@ -48,6 +47,7 @@ class Compiler {
4847 List (new Pickler ) :: // Generate TASTY info
4948 List (new sbt.ExtractAPI ) :: // Sends a representation of the API of classes to sbt via callbacks
5049 List (new Inlining ) :: // Inline and execute macros
50+ List (new sbt.ExtractDependencies ) :: // Sends information on classes' dependencies to sbt via callbacks
5151 List (new PostInlining ) :: // Add mirror support for inlined code
5252 List (new Staging ) :: // Check staging levels and heal staged types
5353 List (new Splicing ) :: // Replace level 1 splices with holes
Original file line number Diff line number Diff line change @@ -227,10 +227,12 @@ private class ExtractDependenciesCollector(rec: DependencyRecorder) extends tpd.
227227 }
228228
229229 tree match {
230- case tree : Inlined if ! tree.inlinedFromOuterScope =>
230+ case tree : Inlined =>
231231 // The inlined call is normally ignored by TreeTraverser but we need to
232232 // record it as a dependency
233- traverse(tree.call)
233+ if ! tree.inlinedFromOuterScope then
234+ traverse(tree.call)
235+ traverseChildren(tree)
234236 case vd : ValDef if vd.symbol.is(ModuleVal ) =>
235237 // Don't visit module val
236238 case t : Template if t.symbol.owner.is(ModuleClass ) =>
Original file line number Diff line number Diff line change 1+ package example
2+
3+ class D0
Original file line number Diff line number Diff line change 1+ package example
2+
3+ class D1
Original file line number Diff line number Diff line change 1+ package example
2+
3+ class D2
Original file line number Diff line number Diff line change 1+ package example
2+
3+ import com .softwaremill .macwire .*
4+
5+ object Test :
6+ try
7+ val d = wire[D0 ]
8+ val d1 = wire[D1 ]
9+ val d2 = wire[D2 ]
10+ catch
11+ case e : Throwable =>
12+ e.printStackTrace()
Original file line number Diff line number Diff line change 1+ name := " add-dep"
2+ libraryDependencies ++= Seq (
3+ " com.softwaremill.macwire" %% " macros" % " 2.6.6" % Provided ,
4+ " com.softwaremill.macwire" %% " util" % " 2.6.6" ,
5+ )
6+ Compile / incOptions ~= { _.withRecompileAllFraction(1.0 ) }
Original file line number Diff line number Diff line change 1+ package example
2+
3+ class D0 (de1 : D1 )
Original file line number Diff line number Diff line change 1+ import sbt ._
2+ import Keys ._
3+
4+ object DottyInjectedPlugin extends AutoPlugin {
5+ override def requires = plugins.JvmPlugin
6+ override def trigger = allRequirements
7+
8+ override val projectSettings = Seq (
9+ scalaVersion := sys.props(" plugin.scalaVersion" )
10+ )
11+ }
Original file line number Diff line number Diff line change 1+ > compile
2+
3+ $ copy-file changes/D0.scala D0.scala
4+
5+ -> compile
You can’t perform that action at this time.
0 commit comments