Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SI-8479 Fix constructor default args under scaladoc
The `DocDef` node hid the `DefDef` constructor from the scrutinee of the namer when determining if the class had constructor defaults or not. The current pattern for fixing these bugs is to delegate the check to `TreeInfo`, and account for the wrapper `DocDef` node. I've followed that pattern, but expressed my feelings about this approach in a TODO comment. Before this patch, the enclosed test failed with: error: not enough arguments for constructor SparkContext: (master: String, appName: String)SparkContext
- Loading branch information
Showing
5 changed files
with
49 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Done. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import scala.tools.nsc.doc.model._ | ||
import scala.tools.nsc.doc.base._ | ||
import scala.tools.nsc.doc.base.comment._ | ||
import scala.tools.partest.ScaladocModelTest | ||
import java.net.{URI, URL} | ||
import java.io.File | ||
|
||
object Test extends ScaladocModelTest { | ||
|
||
override def code = | ||
""" | ||
|object Test { | ||
| val x = new SparkContext(master = "") | ||
|} | ||
| | ||
|class SparkContext(config: Any) { | ||
| | ||
| /** Scaladoc comment */ | ||
| def this( | ||
| master: String, | ||
| appName: String = "") = this(null) | ||
|} | ||
| | ||
| | ||
""".stripMargin | ||
|
||
override def scaladocSettings = "" | ||
|
||
def testModel(rootPackage: Package) { | ||
// it didn't crash | ||
} | ||
} |