summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.xml4
-rw-r--r--src/compiler/scala/tools/nsc/CompileSocket.scala7
-rwxr-xr-xsrc/compiler/scala/tools/nsc/ast/DocComments.scala19
-rw-r--r--src/compiler/scala/tools/nsc/backend/opt/Inliners.scala2
-rw-r--r--src/compiler/scala/tools/nsc/doc/html/HtmlFactory.scala33
-rw-r--r--src/compiler/scala/tools/nsc/doc/html/page/Index.scala16
-rw-r--r--src/compiler/scala/tools/nsc/doc/html/page/Template.scala13
-rw-r--r--src/compiler/scala/tools/nsc/doc/html/resource/lib/filter_box_left.pngbin481 -> 1692 bytes
-rw-r--r--src/compiler/scala/tools/nsc/doc/html/resource/lib/filter_box_right.pngbin533 -> 1803 bytes
-rw-r--r--src/compiler/scala/tools/nsc/doc/html/resource/lib/index.css130
-rw-r--r--src/compiler/scala/tools/nsc/doc/html/resource/lib/index.js6
-rw-r--r--src/compiler/scala/tools/nsc/doc/html/resource/lib/template.css197
-rw-r--r--src/compiler/scala/tools/nsc/doc/html/resource/lib/template.js40
-rw-r--r--src/compiler/scala/tools/nsc/interactive/CompilerControl.scala2
-rw-r--r--src/compiler/scala/tools/nsc/interactive/Global.scala7
-rw-r--r--src/compiler/scala/tools/nsc/transform/LazyVals.scala50
-rw-r--r--src/compiler/scala/tools/nsc/transform/Mixin.scala5
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Infer.scala34
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Namers.scala16
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala61
-rw-r--r--src/library/scala/sys/process/ProcessBuilder.scala6
-rw-r--r--src/library/scala/sys/process/ProcessBuilderImpl.scala9
-rw-r--r--test/files/pos/t4402/A.scala3
-rw-r--r--test/files/pos/t4402/Bar.java7
-rw-r--r--test/files/pos/t4402/Foo.java8
-rw-r--r--test/pending/run/t4283/AbstractFoo.java5
-rw-r--r--test/pending/run/t4283/IllegalAccess.scala5
-rw-r--r--test/pending/run/t4283/ScalaBipp.scala5
-rw-r--r--test/scaladoc/scala/html/HtmlFactoryTest.scala8
29 files changed, 559 insertions, 139 deletions
diff --git a/build.xml b/build.xml
index 1943a36089..b94fccdc08 100644
--- a/build.xml
+++ b/build.xml
@@ -375,7 +375,7 @@ LOCAL REFERENCE BUILD (LOCKER)
<include name="**/*.properties"/>
<include name="**/*.swf"/>
<include name="**/*.png"/>
-
+ <include name="**/*.gif"/>
</fileset>
</copy>
<touch file="${build-locker.dir}/compiler.complete" verbose="no"/>
@@ -590,6 +590,7 @@ QUICK BUILD (QUICK)
<include name="**/*.properties"/>
<include name="**/*.swf"/>
<include name="**/*.png"/>
+ <include name="**/*.gif"/>
</fileset>
</copy>
<touch file="${build-quick.dir}/compiler.complete" verbose="no"/>
@@ -1101,6 +1102,7 @@ BOOTSTRAPPING BUILD (STRAP)
<include name="**/*.properties"/>
<include name="**/*.swf"/>
<include name="**/*.png"/>
+ <include name="**/*.gif"/>
</fileset>
</copy>
<touch file="${build-strap.dir}/compiler.complete" verbose="no"/>
diff --git a/src/compiler/scala/tools/nsc/CompileSocket.scala b/src/compiler/scala/tools/nsc/CompileSocket.scala
index 1e2a367176..a0c39f71fb 100644
--- a/src/compiler/scala/tools/nsc/CompileSocket.scala
+++ b/src/compiler/scala/tools/nsc/CompileSocket.scala
@@ -95,7 +95,12 @@ class CompileSocket extends CompileOutputCommon {
private def startNewServer(vmArgs: String) = {
val cmd = serverCommand(vmArgs split " " toSeq)
info("[Executing command: %s]" format cmd.mkString(" "))
- cmd.daemonized().run()
+
+ // Hiding inadequate daemonized implementation from public API for now
+ Process(cmd) match {
+ case x: ProcessBuilder.AbstractBuilder => x.daemonized().run()
+ case x => x.run()
+ }
}
/** The port identification file */
diff --git a/src/compiler/scala/tools/nsc/ast/DocComments.scala b/src/compiler/scala/tools/nsc/ast/DocComments.scala
index 2e97a3d820..9df0069ada 100755
--- a/src/compiler/scala/tools/nsc/ast/DocComments.scala
+++ b/src/compiler/scala/tools/nsc/ast/DocComments.scala
@@ -328,13 +328,18 @@ trait DocComments { self: SymbolTable =>
pos withStart start1 withPoint start1 withEnd end1
}
- def defineVariables(sym: Symbol) {
- for (str <- defines) {
- val start = skipWhitespace(str, "@define".length)
- var idx = skipVariable(str, start)
- val vble = variableName(str.substring(start, idx))
-
- defs(sym) += vble -> (str drop idx).trim.replaceAll("""\s+\*+$""", "")
+ def defineVariables(sym: Symbol) = {
+ val Trim = "(?s)^[\\s&&[^\n\r]]*(.*?)\\s*$".r
+
+ defs(sym) ++= defines.map {
+ str => {
+ val start = skipWhitespace(str, "@define".length)
+ val (key, value) = str.splitAt(skipVariable(str, start))
+ key.drop(start) -> value
+ }
+ } map {
+ case (key, Trim(value)) =>
+ variableName(key) -> value.replaceAll("\\s+\\*+$", "")
}
}
}
diff --git a/src/compiler/scala/tools/nsc/backend/opt/Inliners.scala b/src/compiler/scala/tools/nsc/backend/opt/Inliners.scala
index aeea6b5452..70e9f78974 100644
--- a/src/compiler/scala/tools/nsc/backend/opt/Inliners.scala
+++ b/src/compiler/scala/tools/nsc/backend/opt/Inliners.scala
@@ -534,7 +534,7 @@ abstract class Inliners extends SubComponent {
if (settings.debug.value)
log("Making not-private symbol out of synthetic: " + f)
- f setFlag Flags.notPRIVATE
+ if (f hasFlag Flags.PRIVATE) f setFlag Flags.notPRIVATE
true
}
diff --git a/src/compiler/scala/tools/nsc/doc/html/HtmlFactory.scala b/src/compiler/scala/tools/nsc/doc/html/HtmlFactory.scala
index f6dc58617e..8d260c2889 100644
--- a/src/compiler/scala/tools/nsc/doc/html/HtmlFactory.scala
+++ b/src/compiler/scala/tools/nsc/doc/html/HtmlFactory.scala
@@ -45,11 +45,11 @@ class HtmlFactory(val universe: doc.Universe, index: doc.Index) {
copyResource("lib/scheduler.js")
copyResource("lib/index.js")
copyResource("lib/template.js")
+
copyResource("lib/index.css")
copyResource("lib/ref-index.css")
copyResource("lib/template.css")
- copyResource("lib/arrow-down.png")
- copyResource("lib/arrow-right.png")
+
copyResource("lib/class.png")
copyResource("lib/class_big.png")
copyResource("lib/object.png")
@@ -58,9 +58,38 @@ class HtmlFactory(val universe: doc.Universe, index: doc.Index) {
copyResource("lib/trait_big.png")
copyResource("lib/package.png")
copyResource("lib/package_big.png")
+
+ copyResource("lib/arrow-down.png")
+ copyResource("lib/arrow-right.png")
copyResource("lib/filter_box_left.png")
copyResource("lib/filter_box_right.png")
+ copyResource("lib/filter_box_left2.gif")
+ copyResource("lib/filterbg.gif")
+ copyResource("lib/filterboxbarbg.gif")
+ copyResource("lib/filterboxbg.gif")
+
+ copyResource("lib/constructorsbg.gif")
+ copyResource("lib/defbg-blue.gif")
+ copyResource("lib/defbg-green.gif")
+ copyResource("lib/fullcommenttopbg.gif")
+ copyResource("lib/ownderbg2.gif")
+ copyResource("lib/ownerbg.gif")
+ copyResource("lib/ownerbg2.gif")
+ copyResource("lib/signaturebg.gif")
+ copyResource("lib/signaturebg2.gif")
+ copyResource("lib/packagesbg.gif")
+ copyResource("lib/typebg.gif")
+ copyResource("lib/valuemembersbg.gif")
+ copyResource("lib/filterboxbarbg.png")
+
copyResource("lib/remove.png")
+ copyResource("lib/navigation-li-a.png")
+ copyResource("lib/navigation-li.png")
+ copyResource("lib/selected-right.png")
+ copyResource("lib/selected.png")
+ copyResource("lib/selected2-right.png")
+ copyResource("lib/selected2.png")
+ copyResource("lib/unselected.png")
new page.Index(universe, index) writeFor this
diff --git a/src/compiler/scala/tools/nsc/doc/html/page/Index.scala b/src/compiler/scala/tools/nsc/doc/html/page/Index.scala
index 4295151952..32ba06737b 100644
--- a/src/compiler/scala/tools/nsc/doc/html/page/Index.scala
+++ b/src/compiler/scala/tools/nsc/doc/html/page/Index.scala
@@ -37,10 +37,10 @@ class Index(universe: doc.Universe, index: doc.Index) extends HtmlPage {
val body =
<body>
<div id="library">
- <img class='class icon' width="13" height="13" src={ relativeLinkTo{List("class.png", "lib")} }/>
- <img class='trait icon' width="13" height="13" src={ relativeLinkTo{List("trait.png", "lib")} }/>
- <img class='object icon' width="13" height="13" src={ relativeLinkTo{List("object.png", "lib")} }/>
- <img class='package icon' width="13" height="13" src={ relativeLinkTo{List("package.png", "lib")} }/>
+ <img class='class icon' src={ relativeLinkTo{List("class.png", "lib")} }/>
+ <img class='trait icon' src={ relativeLinkTo{List("trait.png", "lib")} }/>
+ <img class='object icon' src={ relativeLinkTo{List("object.png", "lib")} }/>
+ <img class='package icon' src={ relativeLinkTo{List("package.png", "lib")} }/>
</div>
{ browser }
<div id="content" class="ui-layout-center">
@@ -66,14 +66,6 @@ class Index(universe: doc.Universe, index: doc.Index) extends HtmlPage {
def browser =
<xml:group>
<div id="browser" class="ui-layout-west">
- <div class="ui-west-north">{
- <div class="letters">
- { for(l <- index.firstLetterIndex.keySet.toList.sortBy( _.toString )) yield { // TODO there should be a better way to do that
- val ch = if(l=='#') "%23" else l // url encoding if needed
- <a target="template" href={"index/index-"+ch+".html"}>{l.toUpper}</a> ++ xml.Text(" ")
- } }
- </div>
- }</div>
<div class="ui-west-center">
<div id="filter"></div>
<div class="pack" id="tpl">{
diff --git a/src/compiler/scala/tools/nsc/doc/html/page/Template.scala b/src/compiler/scala/tools/nsc/doc/html/page/Template.scala
index cd733ced9a..58ed4961a5 100644
--- a/src/compiler/scala/tools/nsc/doc/html/page/Template.scala
+++ b/src/compiler/scala/tools/nsc/doc/html/page/Template.scala
@@ -79,20 +79,23 @@ class Template(tpl: DocTemplateEntity) extends HtmlPage {
{ if (tpl.linearizationTemplates.isEmpty) NodeSeq.Empty else
<div id="order">
<span class="filtertype">Ordering</span>
- <ol><li class="alpha in">Alphabetic</li><li class="inherit out">By inheritance</li></ol>
+ <ol><li class="alpha in"><span>Alphabetic</span></li><li class="inherit out"><span>By inheritance</span></li></ol>
</div>
}
{ if (tpl.linearizationTemplates.isEmpty) NodeSeq.Empty else
<div id="ancestors">
<span class="filtertype">Inherited</span>
- <ol><li class="hideall">Hide All</li><li class="showall">Show all</li></ol>
- <ol id="linearization">{ (tpl :: tpl.linearizationTemplates) map { wte => <li class="in" name={ wte.qualifiedName }>{ wte.name }</li> } }</ol>
+ <ol><li class="hideall out"><span>Hide All</span></li>
+ <li class="showall in"><span>Show all</span></li></ol>
+ <ol id="linearization">{
+ (tpl :: tpl.linearizationTemplates) map { wte => <li class="in" name={ wte.qualifiedName }><span>{ wte.name }</span></li> }
+ }</ol>
</div>
}
{
<div id="visbl">
<span class="filtertype">Visibility</span>
- <ol><li class="public in">Public</li><li class="all out">All</li></ol>
+ <ol><li class="public in"><span>Public</span></li><li class="all out"><span>All</span></li></ol>
</div>
}
</div>
@@ -197,7 +200,7 @@ class Template(tpl: DocTemplateEntity) extends HtmlPage {
case dte: DocTemplateEntity if isSelf =>
// comment of class itself
<xml:group>
- <div id="comment" class="fullcomment">{ memberToCommentBodyHtml(mbr, isSelf = true) }</div>
+ <div id="comment" class="fullcommenttop">{ memberToCommentBodyHtml(mbr, isSelf = true) }</div>
</xml:group>
case dte: DocTemplateEntity if mbr.comment.isDefined =>
// comment of inner, documented class (only short comment, full comment is on the class' own page)
diff --git a/src/compiler/scala/tools/nsc/doc/html/resource/lib/filter_box_left.png b/src/compiler/scala/tools/nsc/doc/html/resource/lib/filter_box_left.png
index 4127dbf3c2..0e8c893315 100644
--- a/src/compiler/scala/tools/nsc/doc/html/resource/lib/filter_box_left.png
+++ b/src/compiler/scala/tools/nsc/doc/html/resource/lib/filter_box_left.png
Binary files differ
diff --git a/src/compiler/scala/tools/nsc/doc/html/resource/lib/filter_box_right.png b/src/compiler/scala/tools/nsc/doc/html/resource/lib/filter_box_right.png
index 942736e44d..f127e35b48 100644
--- a/src/compiler/scala/tools/nsc/doc/html/resource/lib/filter_box_right.png
+++ b/src/compiler/scala/tools/nsc/doc/html/resource/lib/filter_box_right.png
Binary files differ
diff --git a/src/compiler/scala/tools/nsc/doc/html/resource/lib/index.css b/src/compiler/scala/tools/nsc/doc/html/resource/lib/index.css
index 7c05678313..df89781d10 100644
--- a/src/compiler/scala/tools/nsc/doc/html/resource/lib/index.css
+++ b/src/compiler/scala/tools/nsc/doc/html/resource/lib/index.css
@@ -2,7 +2,7 @@
color: inherit;
font-size: 10pt;
text-decoration: none;
- font-family: sans-serif;
+ font-family: Arial;
border-width: 0px;
padding: 0px;
margin: 0px;
@@ -20,9 +20,13 @@ h1 {
display: none;
}
-.letters {
+/*.letters {
+ font-family: monospace;
+ font-size: 2pt;
padding: 5px;
-}
+ background-color: #DADADA;
+ text-shadow: #ffffff 0 1px 0;
+}*/
#library {
display: none;
@@ -40,16 +44,70 @@ h1 {
#filter {
position: absolute;
display: block;
- padding: 5px;
+/* padding: 5px;*/
right: 0;
left: 0;
top: 0;
- background-color: #DADADA;
+ background-image:url('filterbg.gif');
+ background-repeat:repeat-x;
+ background-color: #ededee; /* light gray */
+ /*background-color: #DADADA;*/
+ border:1px solid #bbbbbb;
+ border-top:0;
+ border-left:0;
+ border-right:0;
}
#textfilter {
position: relative;
display: block;
+ height: 20px;
+ margin-top: 5px;
+ margin-bottom: 5px;
+}
+
+#textfilter > .pre {
+ display: block;
+ position: absolute;
+ top: 0;
+ left: 0;
+ height: 23px;
+ width: 21px;
+ background: url("filter_box_left.png");
+}
+
+#textfilter > .input {
+ display: block;
+ position: absolute;
+ top: 0;
+ right: 20px;
+ left: 20px;
+}
+
+#textfilter > .input > input {
+ height: 21px;
+ padding: 1px;
+ font-weight: bold;
+ color: #000000;
+ background-color: white;
+ background: url("filterboxbarbg.png");
+ background-repeat:repeat-x;
+ width: 100%;
+}
+
+#textfilter > .post {
+ display: block;
+ position: absolute;
+ top: 0;
+ right: 0;
+ height: 23px;
+ width: 21px;
+ background: url("filter_box_right.png");
+}
+
+/*#textfilter {
+ position: relative;
+ display: block;
height: 20px;
margin-bottom: 5px;
}
@@ -89,17 +147,20 @@ h1 {
height: 20px;
width: 20px;
background: url("filter_box_right.png");
-}
+}*/
#focusfilter {
position: relative;
+ text-align: center;
display: block;
padding: 5px;
- background-color: pink;
+ background-color: #fffebd; /* light yellow*/
+ text-shadow: #ffffff 0 1px 0;
}
#focusfilter .focuscoll {
font-weight: bold;
+ text-shadow: #ffffff 0 1px 0;
}
#focusfilter img {
@@ -111,14 +172,41 @@ h1 {
position: relative;
display: block;
padding: 5px;
- background-color: #999;
+/* background-color: #999;*/
text-align: center;
}
-
#kindfilter > a {
- color: white;
- text-decoration: underline;
+ color: black;
+/* text-decoration: underline;*/
+ text-shadow: #ffffff 0 1px 0;
+
+}
+
+#kindfilter > a:hover {
+ color: #4C4C4C;
+ text-decoration: none;
+ text-shadow: #ffffff 0 1px 0;
+
+}
+
+#letters {
+ position: relative;
+ text-align: center;
+ padding-bottom: 5px;
+ border:1px solid #bbbbbb;
+ border-top:0;
+ border-left:0;
+ border-right:0;
+}
+
+#letters > a {
+/* font-family: monospace;*/
+ color: #858484;
+ font-weight: bold;
+ font-size: 8pt;
+ text-shadow: #ffffff 0 1px 0;
+ padding-right: 2px;
}
#tpl {
@@ -149,23 +237,28 @@ h1 {
}
#tpl .packages > ol {
+ background-color: #dadfe6;
/*margin-bottom: 5px;*/
}
-#tpl .packages > ol > li {
+/*#tpl .packages > ol > li {
margin-bottom: 1px;
-}
+}*/
#tpl .packages > li > h3 {
display: block;
color: white;
font-weight: bold;
display: block;
+ text-shadow: #000000 0 1px 0;
}
#tpl ol > li.pack {
- background-color: #2C475C;
padding: 3px 5px;
+ background: url("packagesbg.gif");
+ background-repeat:repeat-x;
+ min-height: 14px;
+ background-color: #6e808e;
}
#tpl ol > li {
@@ -174,6 +267,7 @@ h1 {
#tpl .templates > li {
padding-left: 5px;
+ min-height: 18px;
}
#tpl ol > li .icon {
@@ -217,7 +311,13 @@ h1 {
}
.ui-layout-resizer {
- background: #DDD;
+ background-image:url('filterbg.gif');
+ background-repeat:repeat-x;
+ background-color: #ededee; /* light gray */
+ border:1px solid #bbbbbb;
+ border-top:0;
+ border-bottom:0;
+ border-left: 0;
}
.ui-layout-toggler {
diff --git a/src/compiler/scala/tools/nsc/doc/html/resource/lib/index.js b/src/compiler/scala/tools/nsc/doc/html/resource/lib/index.js
index b06d5dc369..1a574a8752 100644
--- a/src/compiler/scala/tools/nsc/doc/html/resource/lib/index.js
+++ b/src/compiler/scala/tools/nsc/doc/html/resource/lib/index.js
@@ -209,6 +209,7 @@ function prepareEntityList() {
function configureTextFilter() {
scheduler.add("init", function() {
$("#filter").append("<div id='textfilter'><span class='pre'/><span class='input'><input type='text' accesskey='/'/></span><span class='post'/></div>");
+ printAlphabet();
var input = $("#textfilter input");
resizeFilterBlock();
input.bind("keyup", function(event) {
@@ -391,3 +392,8 @@ function kindFilterSync() {
function resizeFilterBlock() {
$("#tpl").css("top", $("#filter").outerHeight(true));
}
+
+function printAlphabet() {
+ $("#filter").append("<div id='letters'><a target='template' href='index/index-%23.html'>#</a><a target='template' href='index/index-a.html'>A</a><a target='template' href='index/index-b.html'>B</a><a target='template' href='index/index-c.html'>C</a><a target='template' href='index/index-d.html'>D</a><a target='template' href='index/index-e.html'>E</a><a target='template' href='index/index-f.html'>F</a><a target='template' href='index/index-g.html'>G</a><a target='template' href='index/index-h.html'>H</a><a target='template' href='index/index-i.html'>I</a><a target='template' href='index/index-j.html'>J</a><a target='template' href='index/index-k.html'>K</a><a target='template' href='index/index-l.html'>L</a><a target='template' href='index/index-m.html'>M</a><a target='template' href='index/index-n.html'>N</a><a target='template' href='index/index-o.html'>O</a><a target='template' href='index/index-p.html'>P</a><a target='template' href='index/index-q.html'>Q</a><a target='template' href='index/index-r.html'>R</a><a target='template' href='index/index-s.html'>S</a><a target='template' href='index/index-t.html'>T</a><a target='template' href='index/index-u.html'>U</a><a target='template' href='index/index-v.html'>V</a><a target='template' href='index/index-w.html'>W</a><a target='template' href='index/index-x.html'>X</a><a target='template' href='index/index-y.html'>Y</a><a target='template' href='index/index-z.html'>Z</a></div>");
+}
+
diff --git a/src/compiler/scala/tools/nsc/doc/html/resource/lib/template.css b/src/compiler/scala/tools/nsc/doc/html/resource/lib/template.css
index 192a56f9bb..1fb2cbdbc2 100644
--- a/src/compiler/scala/tools/nsc/doc/html/resource/lib/template.css
+++ b/src/compiler/scala/tools/nsc/doc/html/resource/lib/template.css
@@ -30,7 +30,7 @@ input { border-width: 0px; }
/* Page */
body {
- font-family: sans-serif;
+ font-family: Arial;
font-size: 10pt;
}
@@ -45,12 +45,23 @@ a[href]:hover {
#owner {
padding: 2px 10px 5px;
+ height: 17px;
font-size: 12pt;
display: block;
}
#owner a {
color: black;
+/* text-decoration: none;*/
+/* font-weight: bold;*/
+/* text-shadow: white 0px 1px 0px;*/
+}
+
+#owner a:hover {
+ color: black;
+ text-decoration: none;
+/* font-weight: bold;*/
+/* text-shadow: white 0px 1px 0px;*/
}
.value #owner {
@@ -58,16 +69,23 @@ a[href]:hover {
}
.type #owner {
- background-color: #699D84; /* lighter green */
+ background-color: #95b8a1; /* lighter green */
+/* background-image:url('ownerbg2.gif');
+ background-repeat:repeat-x;*/
}
#types ol li > p {
margin-top: 5px;
}
+#types ol li:last-child {
+ margin-bottom: 5px;
+}
+
#definition {
display: block;
padding: 5px 6px;
+ height: 61px;
}
#definition > img {
@@ -77,19 +95,33 @@ a[href]:hover {
#definition > h1 {
padding: 12px 0 12px 6px;
color: white;
+ text-shadow: 3px black;
+ text-shadow: black 0px 2px 0px;
font-size: 24pt;
display: inline-block;
}
#definition h1 > a {
- color: white;
+ color: #ffffff;
+/* text-decoration: none; */
font-size: 24pt;
+ text-shadow: black 0px 0px 0px;
+}
+
+#definition h1 > a:hover {
+ color: #ffffff;
+ text-decoration: none;
+ font-size: 24pt;
+ text-shadow: black 0px 2px 0px;
}
#signature {
- background-color: #EBEBEB;
+ background-image:url('signaturebg2.gif');
+ background-color: #d7d7d7;
+ min-height: 18px;
+ background-repeat:repeat-x;
font-size: 11.5pt;
- margin-bottom: 10px;
+/* margin-bottom: 10px;*/
padding: 8px;
}
@@ -99,12 +131,16 @@ a[href]:hover {
text-align: left;
width: auto;
position: static;
+ text-shadow: 2px white;
+ text-shadow: white 0px 1px 0px;
}
#signature > span.symbol {
text-align: left;
display: inline;
padding-left: 0.7em;
+ text-shadow: 2px white;
+ text-shadow: white 0px 1px 0px;
}
/* Linear super types and known subclasses */
@@ -140,10 +176,14 @@ div.superTypes > h1 {
.value #definition {
background-color: #2C475C; /* blue */
+ background-image:url('defbg-blue.gif');
+ background-repeat:repeat-x;
}
.type #definition {
background-color: #316555; /* green */
+ background-image:url('defbg-green.gif');
+ background-repeat:repeat-x;
}
#template {
@@ -155,6 +195,7 @@ h3 {
padding: 5px 10px;
font-size: 12pt;
font-weight: bold;
+ text-shadow: black 1px 1px 0px;
}
dl.attributes > dt {
@@ -171,19 +212,41 @@ dl.attributes > dd {
#template .values > h3 {
background-color: #315479; /* grayish blue */
+ background: url("valuemembersbg.gif");
+ background-repeat:repeat-x;
+ height: 28px;
+}
+
+#values ol li:last-child {
+ margin-bottom: 5px;
}
#template .types > h3 {
background-color: #316555; /* green */
+ background: url("typebg.gif");
+ background-repeat:repeat-x;
+ height: 28px;
}
#constructors > h3 {
background-color: #333;
+ background: url("constructorsbg.gif");
+ background-repeat:repeat-x;
+ height: 28px;
}
#template > div.parent > h3 {
- background-color: #3B3B3B;
+ background-color: #dadada;
+/* border:1px solid #6f6f6f;
+ border-left:0;
+ border-right:0;*/
+ background: url("constructorsbg.gif");
+ background-repeat:repeat-x;
+ height: 17px;
margin-top: 10px;
+/* color: black;
+ text-shadow: white 0px 1px 0px;
+ font-weight: normal;8*/
font-style: italic;
font-size: 12pt;
}
@@ -229,6 +292,8 @@ div.members > ol > li:last-child {
line-height: 18px;
clear: both;
display: block;
+ text-shadow: 2px white;
+ text-shadow: white 0px 1px 0px;
}
.signature .kind {
@@ -405,10 +470,17 @@ p.comment {
margin: 5px 10px;
}
+div.fullcommenttop {
+ padding: 10px 10px;
+ background-image:url('fullcommenttopbg.gif');
+ background-repeat:repeat-x;
+}
+
div.fullcomment {
margin: 5px 10px;
}
+#template div.fullcommenttop,
#template div.fullcomment {
display:none;
margin: 5px 0 0 8.7em;
@@ -425,6 +497,13 @@ div.fullcomment .block {
margin-top: 5px;
}
+div.fullcommenttop .block {
+ padding: 5px 0 0;
+ border-top: 1px solid #EBEBEB;
+ margin-top: 5px;
+ margin-bottom: 5px
+}
+
div.fullcomment div.block ol li p,
div.fullcomment div.block ol li {
display:inline
@@ -440,16 +519,20 @@ div.fullcomment .comment {
margin: 5px 0 10px;
}
+div.fullcommenttop .comment:last-child,
div.fullcomment .comment:last-child {
margin-bottom: 0;
}
+
+div.fullcommenttop dl.paramcmts > dt,
div.fullcomment dl.paramcmts > dt {
display: block;
float: left;
font-weight: bold;
}
+div.fullcommenttop dl.paramcmts > dd,
div.fullcomment dl.paramcmts > dd {
display: block;
padding-left: 80px;
@@ -470,8 +553,8 @@ div.fullcomment dl.paramcmts > dd {
position: absolute;
top: 0;
left: 0;
- height: 20px;
- width: 20px;
+ height: 23px;
+ width: 21px;
background: url("filter_box_left.png");
}
@@ -484,12 +567,14 @@ div.fullcomment dl.paramcmts > dd {
}
#textfilter > .input > input {
- height: 16px;
- padding: 2px;
- font-weight: bold;
- color: #993300;
+ height: 21px;
+ padding: 1px;
+ font-weight: bold;
+ color: #000000;
background-color: white;
- width: 100%;
+ background: url("filterboxbarbg.png");
+ background-repeat:repeat-x;
+ width: 100%;
}
#textfilter > .post {
@@ -497,14 +582,16 @@ div.fullcomment dl.paramcmts > dd {
position: absolute;
top: 0;
right: 0;
- height: 20px;
- width: 20px;
+ height: 23px;
+ width: 21px;
background: url("filter_box_right.png");
}
#mbrsel {
padding: 5px 10px;
- background-color: #DADADA; /* light gray */
+ background-color: #ededee; /* light gray */
+ background-image:url('filterboxbg.gif');
+ background-repeat:repeat-x;
font-size: 9.5pt;
display: block;
margin-top: 1em;
@@ -520,47 +607,103 @@ div.fullcomment dl.paramcmts > dd {
}
#mbrsel > div > span.filtertype {
- padding: 3px 0;
+ padding: 4px;
+ margin-right: 5px;
float: left;
display: inline-block;
- color: #404040;
+ color: #000000;
+ font-weight: bold;
+ text-shadow: white 0px 1px 0px;
width: 4.5em;
}
#mbrsel > div > ol {
display: inline-block;
- /*background-color: white;*/
}
#mbrsel > div > ol#linearization {
- display: block;
- margin-left: 4.5em;
- margin-top: 5px;
+ display: table;
+ margin-left: 70px;
+}
+
+#mbrsel > div > ol#linearization > li.in {
+ text-decoration: none;
+ float: left;
+ padding-right: 10px;
+ margin-right: 5px;
+ background: url(selected-right.png) no-repeat;
+ background-position: right 0px;
+}
+
+#mbrsel > div > ol#linearization > li.in > span{
+ color: #4C4C4C;
+ float: left;
+ padding: 1px 0 1px 10px;
+ background: url(selected.png) no-repeat;
+ background-position: 0px 0px;
+ text-shadow: #ffffff 0 1px 0;
}
#mbrsel > div > ol > li {
- padding: 3px 10px;
- background-color: white;
+/* padding: 3px 10px;*/
+ line-height: 16pt;
display: inline-block;
cursor: pointer;
}
#mbrsel > div > ol > li.in {
- background-color: white;
+ text-decoration: none;
+ float: left;
+ padding-right: 10px;
+ margin-right: 5px;
+ background: url(selected-right.png) no-repeat;
+ background-position: right 0px;
+}
+
+#mbrsel > div > ol > li.in > span{
color: #4C4C4C;
+ float: left;
+ padding: 1px 0 1px 10px;
+ background: url(selected.png) no-repeat;
+ background-position: 0px 0px;
+ text-shadow: #ffffff 0 1px 0;
}
#mbrsel > div > ol > li.out {
- color: #4B4B4B;
- background-color: #999;
+ text-decoration: none;
+ float: left;
+ padding-right: 10px;
+ margin-right: 5px;
}
+#mbrsel > div > ol > li.out > span{
+ color: #4B4B4B;
+/* background-color: #999; */
+ float: left;
+ padding: 1px 0 1px 10px;
+/* background: url(unselected.png) no-repeat;*/
+ background-position: 0px -1px;
+ text-shadow: #ffffff 0 1px 0;
+}
+/*
#mbrsel .hideall {
color: #4C4C4C;
+ line-height: 16px;
+ font-weight: bold;
+}
+
+#mbrsel .hideall span {
+ color: #4C4C4C;
font-weight: bold;
}
#mbrsel .showall {
color: #4C4C4C;
+ line-height: 16px;
font-weight: bold;
}
+
+#mbrsel .showall span {
+ color: #4C4C4C;
+ font-weight: bold;
+}*/ \ No newline at end of file
diff --git a/src/compiler/scala/tools/nsc/doc/html/resource/lib/template.js b/src/compiler/scala/tools/nsc/doc/html/resource/lib/template.js
index 14a5613015..e848078aca 100644
--- a/src/compiler/scala/tools/nsc/doc/html/resource/lib/template.js
+++ b/src/compiler/scala/tools/nsc/doc/html/resource/lib/template.js
@@ -42,6 +42,8 @@ $(document).ready(function(){
};
filter();
});
+
+/*
$("#ancestors > ol > li.hideall").click(function() {
$("#linearization li.in").removeClass("in").addClass("out");
$("#linearization li:first").removeClass("out").addClass("in");
@@ -55,6 +57,32 @@ $(document).ready(function(){
filtered.removeClass("out").addClass("in");
filter();
});
+*/
+
+
+ $("#ancestors > ol > li.hideall").click(function() {
+ if ($(this).hasClass("out")) {
+ $(this).removeClass("out").addClass("in");
+ $("#ancestors > ol > li.showall").removeClass("in").addClass("out");
+ $("#linearization li.in").removeClass("in").addClass("out");
+ $("#linearization li:first").removeClass("out").addClass("in");
+ filter();
+ };
+ })
+ $("#ancestors > ol > li.showall").click(function() {
+ if($(this).hasClass("out")){
+ $(this).removeClass("out").addClass("in");
+ $("#ancestors > ol > li.hideall").removeClass("in").addClass("out");
+ var filtered =
+ $("#linearization li.out").filter(function() {
+ return ! isHiddenClass($(this).attr("name"));
+ });
+ filtered.removeClass("out").addClass("in");
+ filter();
+ };
+ });
+
+
$("#visbl > ol > li.public").click(function() {
if ($(this).hasClass("out")) {
$(this).removeClass("out").addClass("in");
@@ -112,12 +140,16 @@ $(document).ready(function(){
var vis = $(":visible", fullComment);
signature.toggleClass("closed").toggleClass("opened");
if (vis.length > 0) {
- shortComment.slideDown(100);
- fullComment.slideUp(100);
+ shortComment.slideDown(50);
+ fullComment.slideUp(50);
+ signature.addClass("closed");
+ signature.removeClass("opened");
}
else {
- shortComment.slideUp(100);
- fullComment.slideDown(100);
+ shortComment.slideUp(50);
+ fullComment.slideDown(50);
+ signature.removeClass("closed");
+ signature.addClass("opened");
}
};
docAllSigs.addClass("closed");
diff --git a/src/compiler/scala/tools/nsc/interactive/CompilerControl.scala b/src/compiler/scala/tools/nsc/interactive/CompilerControl.scala
index 8ec93d70e3..64178b5eac 100644
--- a/src/compiler/scala/tools/nsc/interactive/CompilerControl.scala
+++ b/src/compiler/scala/tools/nsc/interactive/CompilerControl.scala
@@ -253,7 +253,7 @@ trait CompilerControl { self: Global =>
// items that get sent to scheduler
abstract class WorkItem extends (() => Unit) {
- def onCompilerThread = self.onCompilerThread
+ val onCompilerThread = self.onCompilerThread
}
case class ReloadItem(sources: List[SourceFile], response: Response[Unit]) extends WorkItem {
diff --git a/src/compiler/scala/tools/nsc/interactive/Global.scala b/src/compiler/scala/tools/nsc/interactive/Global.scala
index 2563feeb72..9b50b82bb3 100644
--- a/src/compiler/scala/tools/nsc/interactive/Global.scala
+++ b/src/compiler/scala/tools/nsc/interactive/Global.scala
@@ -537,11 +537,12 @@ class Global(settings: Settings, reporter: Reporter, projectName: String = "")
} catch {
case CancelException =>
debugLog("cancelled")
-/* Commented out. Typing should always cancel requests
case ex @ FreshRunReq =>
- scheduler.postWorkItem(() => respondGradually(response)(op))
+ if (debugIDE) {
+ println("FreshRunReq thrown during response")
+ }
+ response raise ex
throw ex
-*/
case ex =>
if (debugIDE) {
println("exception thrown during response: "+ex)
diff --git a/src/compiler/scala/tools/nsc/transform/LazyVals.scala b/src/compiler/scala/tools/nsc/transform/LazyVals.scala
index 2ab7daa901..9708372ee4 100644
--- a/src/compiler/scala/tools/nsc/transform/LazyVals.scala
+++ b/src/compiler/scala/tools/nsc/transform/LazyVals.scala
@@ -72,11 +72,21 @@ abstract class LazyVals extends Transform with TypingTransformers with ast.TreeD
tree match {
case DefDef(mods, name, tparams, vparams, tpt, rhs) => atOwner(tree.symbol) {
val res = if (!sym.owner.isClass && sym.isLazy) {
- val enclosingDummyOrMethod =
- if (sym.enclMethod == NoSymbol) sym.owner else sym.enclMethod
- val idx = lazyVals(enclosingDummyOrMethod)
- lazyVals(enclosingDummyOrMethod) = idx + 1
- val rhs1 = mkLazyDef(enclosingDummyOrMethod, super.transform(rhs), idx, sym)
+ val enclosingClassOrDummyOrMethod = {
+ val enclMethod = sym.enclMethod
+
+ if (enclMethod != NoSymbol ) {
+ val enclClass = sym.enclClass
+ if (enclClass != NoSymbol && enclMethod == enclClass.enclMethod)
+ enclClass
+ else
+ enclMethod
+ } else
+ sym.owner
+ }
+ val idx = lazyVals(enclosingClassOrDummyOrMethod)
+ lazyVals(enclosingClassOrDummyOrMethod) = idx + 1
+ val rhs1 = mkLazyDef(enclosingClassOrDummyOrMethod, super.transform(rhs), idx, sym)
sym.resetFlag((if (lazyUnit(sym)) 0 else LAZY) | ACCESSOR)
rhs1
} else
@@ -103,7 +113,18 @@ abstract class LazyVals extends Transform with TypingTransformers with ast.TreeD
case _ =>
stat
}
- treeCopy.Template(tree, parents, self, stats)
+ val innerClassBitmaps = if (!added && currentOwner.isClass && bitmaps.contains(currentOwner)) {
+ // add bitmap to inner class if necessary
+ val toAdd0 = bitmaps(currentOwner).map(s => typed(ValDef(s, ZERO)))
+ toAdd0.foreach(t => {
+ if (currentOwner.info.decl(t.symbol.name) == NoSymbol) {
+ t.symbol.setFlag(PROTECTED)
+ currentOwner.info.decls.enter(t.symbol)
+ }
+ })
+ toAdd0
+ } else List()
+ treeCopy.Template(tree, parents, self, innerClassBitmaps ++ stats)
}
case ValDef(mods, name, tpt, rhs0) if (!sym.owner.isModule && !sym.owner.isClass) =>
@@ -186,10 +207,13 @@ abstract class LazyVals extends Transform with TypingTransformers with ast.TreeD
* ()
* }
*/
- private def mkLazyDef(meth: Symbol, tree: Tree, offset: Int, lazyVal: Symbol): Tree = {
- val bitmapSym = getBitmapFor(meth, offset)
+ private def mkLazyDef(methOrClass: Symbol, tree: Tree, offset: Int, lazyVal: Symbol): Tree = {
+ val bitmapSym = getBitmapFor(methOrClass, offset)
val mask = LIT(1 << (offset % FLAGS_PER_WORD))
- def mkBlock(stmt: Tree) = BLOCK(stmt, mkSetFlag(bitmapSym, mask), UNIT)
+ val bitmapRef = if (methOrClass.isClass) Select(This(methOrClass), bitmapSym) else Ident(bitmapSym)
+
+ def mkBlock(stmt: Tree) = BLOCK(stmt, mkSetFlag(bitmapSym, mask, bitmapRef), UNIT)
+
val (block, res) = tree match {
case Block(List(assignment), res) if !lazyUnit(lazyVal) =>
@@ -198,16 +222,16 @@ abstract class LazyVals extends Transform with TypingTransformers with ast.TreeD
(mkBlock(rhs), UNIT)
}
- val cond = (Ident(bitmapSym) INT_& mask) INT_== ZERO
+ val cond = (bitmapRef INT_& mask) INT_== ZERO
atPos(tree.pos)(localTyper.typed {
- def body = gen.mkDoubleCheckedLocking(meth.enclClass, cond, List(block), Nil)
+ def body = gen.mkDoubleCheckedLocking(methOrClass.enclClass, cond, List(block), Nil)
BLOCK(body, res)
})
}
- private def mkSetFlag(bmp: Symbol, mask: Tree): Tree =
- Ident(bmp) === (Ident(bmp) INT_| mask)
+ private def mkSetFlag(bmp: Symbol, mask: Tree, bmpRef: Tree): Tree =
+ bmpRef === (bmpRef INT_| mask)
val bitmaps = new mutable.HashMap[Symbol, List[Symbol]] {
override def default(meth: Symbol) = Nil
diff --git a/src/compiler/scala/tools/nsc/transform/Mixin.scala b/src/compiler/scala/tools/nsc/transform/Mixin.scala
index 49f5907245..d98281aaa4 100644
--- a/src/compiler/scala/tools/nsc/transform/Mixin.scala
+++ b/src/compiler/scala/tools/nsc/transform/Mixin.scala
@@ -675,7 +675,7 @@ abstract class Mixin extends InfoTransform with ast.TreeDSL {
def bitmapOperation[T](field: Symbol, transientCase: => T, privateCase: => T, rest: => T): T =
if (field.accessed.hasAnnotation(TransientAttr))
transientCase
- else if (field.hasFlag(PRIVATE))
+ else if (field.hasFlag(PRIVATE) || field.hasFlag(notPRIVATE))
privateCase
else
rest
@@ -686,7 +686,7 @@ abstract class Mixin extends InfoTransform with ast.TreeDSL {
* Similarly fields in the checkinit mode use private bitmaps.
*/
def localBitmapField(field: Symbol) =
- field.accessed.hasAnnotation(TransientAttr) || field.hasFlag(PRIVATE) || checkinitField(field)
+ field.accessed.hasAnnotation(TransientAttr) || field.hasFlag(PRIVATE | notPRIVATE) || checkinitField(field)
/**
* Return the bitmap field for 'offset'. Depending on the hierarchy it is possible to reuse
@@ -705,7 +705,6 @@ abstract class Mixin extends InfoTransform with ast.TreeDSL {
val bitmapName = if (checkinitField) bitmapCheckinitName else bitmapLazyName
def createBitmap: Symbol = {
-
val sym = clazz0.newVariable(clazz0.pos, bitmapName).setInfo(IntClass.tpe)
atPhase(currentRun.typerPhase) {
sym addAnnotation AnnotationInfo(VolatileAttr.tpe, Nil, Nil)
diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala
index 296e555559..d198303d66 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala
@@ -234,14 +234,6 @@ trait Infer {
def explainTypes(tp1: Type, tp2: Type) =
withDisambiguation(tp1, tp2)(global.explainTypes(tp1, tp2))
- def accessError(tree: Tree, sym: Symbol, pre: Type, explanation: String): Tree = {
- val realsym = underlying(sym)
-
- errorTree(tree, realsym + realsym.locationString + " cannot be accessed in " +
- (if (sym.isClassConstructor) context.enclClass.owner else pre.widen) +
- explanation)
- }
-
/* -- Tests & Checks---------------------------------------------------- */
/** Check that <code>sym</code> is defined and accessible as a member of
@@ -258,16 +250,19 @@ trait Infer {
if (context.unit != null)
context.unit.depends += sym.toplevelClass
- val sym1 = sym filter (alt => context.isAccessible(alt, pre, site.isInstanceOf[Super]))
+ var sym1 = sym filter (alt => context.isAccessible(alt, pre, site.isInstanceOf[Super]))
// Console.println("check acc " + (sym, sym1) + ":" + (sym.tpe, sym1.tpe) + " from " + pre);//DEBUG
+ if (sym1 == NoSymbol && sym.isJavaDefined && context.unit.isJava) // don't try to second guess Java; see #4402
+ sym1 = sym
+
if (sym1 == NoSymbol) {
if (settings.debug.value) {
Console.println(context)
Console.println(tree)
Console.println("" + pre + " " + sym.owner + " " + context.owner + " " + context.outer.enclClass.owner + " " + sym.owner.thisType + (pre =:= sym.owner.thisType))
}
- accessError(tree, sym, pre,
+ new AccessError(tree, sym, pre,
if (settings.check.isDefault) {
analyzer.lastAccessCheckDetails
} else {
@@ -295,10 +290,10 @@ trait Infer {
if (settings.debug.value) ex.printStackTrace
val sym2 = underlying(sym1)
val itype = pre.memberType(sym2)
- accessError(tree, sym, pre,
+ new AccessError(tree, sym, pre,
"\n because its instance type "+itype+
(if ("malformed type: "+itype.toString==ex.msg) " is malformed"
- else " contains a "+ex.msg))
+ else " contains a "+ex.msg)).emit()
ErrorType
}
if (pre.isInstanceOf[SuperType])
@@ -1697,6 +1692,21 @@ trait Infer {
// Side effects tree with symbol and type
tree setSymbol resSym setType resTpe
}
+
+ case class AccessError(tree: Tree, sym: Symbol, pre: Type, explanation: String) extends Tree {
+ override def pos = tree.pos
+ override def hasSymbol = tree.hasSymbol
+ override def symbol = tree.symbol
+ override def symbol_=(x: Symbol) = tree.symbol = x
+ setError(this)
+
+ def emit(): Tree = {
+ val realsym = underlying(sym)
+ errorTree(tree, realsym + realsym.locationString + " cannot be accessed in " +
+ (if (sym.isClassConstructor) context.enclClass.owner else pre.widen) +
+ explanation)
+ }
+ }
}
}
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
index f966e1476c..3b3eb74745 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
@@ -557,7 +557,7 @@ trait Namers { self: Analyzer =>
}
case _ =>
}
- sym.setInfo(tp)
+ sym.setInfo(if (sym.isJavaDefined) RestrictJavaArraysMap(tp) else tp)
if ((sym.isAliasType || sym.isAbstractType) && !sym.isParameter &&
!typer.checkNonCyclic(tree.pos, tp))
sym.setInfo(ErrorType) // this early test is there to avoid infinite baseTypes when
@@ -1279,6 +1279,20 @@ trait Namers { self: Analyzer =>
}
}
+ /** Convert Java generic array type T[] to (T with Object)[]
+ * (this is necessary because such arrays have a representation which is incompatible
+ * with arrays of primitive types.)
+ */
+ private object RestrictJavaArraysMap extends TypeMap {
+ def apply(tp: Type): Type = tp match {
+ case TypeRef(pre, ArrayClass, List(elemtp))
+ if elemtp.typeSymbol.isAbstractType && !(elemtp <:< definitions.ObjectClass.tpe) =>
+ TypeRef(pre, ArrayClass, List(intersectionType(List(elemtp, definitions.ObjectClass.tpe))))
+ case _ =>
+ mapOver(tp)
+ }
+ }
+
/** Check that symbol's definition is well-formed. This means:
* - no conflicting modifiers
* - `abstract' modifier only for classes
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 3afbc5640b..09786a4aae 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -991,6 +991,32 @@ trait Typers extends Modes {
doAdapt(pt)
}
+ /** Try o apply an implicit conversion to `qual' to that it contains
+ * a method `name`. If that's ambiguous try taking arguments into account using `adaptToArguments`.
+ */
+ def adaptToMemberWithArgs(tree: Tree, qual: Tree, name: Name, mode: Int): Tree = {
+ try {
+ adaptToMember(qual, HasMember(name))
+ } catch {
+ case ex: TypeError =>
+ // this happens if implicits are ambiguous; try again with more context info.
+ // println("last ditch effort: "+qual+" . "+name)
+ context.tree match {
+ case Apply(tree1, args) if (tree1 eq tree) && args.nonEmpty => // try handling the arguments
+ // println("typing args: "+args)
+ silent(_.typedArgs(args, mode)) match {
+ case args: List[_] =>
+ adaptToArguments(qual, name, args.asInstanceOf[List[Tree]], WildcardType)
+ case _ =>
+ throw ex
+ }
+ case _ =>
+ // println("not in an apply: "+context.tree+"/"+tree)
+ throw ex
+ }
+ }
+ }
+
/** Try to apply an implicit conversion to `qual' to that it contains a
* member `name` of arbitrary type.
* If no conversion is found, return `qual' unchanged.
@@ -3452,8 +3478,6 @@ trait Typers extends Modes {
* @return ...
*/
def typedSelect(qual: Tree, name: Name): Tree = {
-
-
val sym =
if (tree.symbol != NoSymbol) {
if (phase.erasedTypes && qual.isInstanceOf[Super])
@@ -3472,26 +3496,9 @@ trait Typers extends Modes {
member(qual, name)
}
if (sym == NoSymbol && name != nme.CONSTRUCTOR && (mode & EXPRmode) != 0) {
- val qual1 = try {
- adaptToName(qual, name)
- } catch {
- case ex: TypeError =>
- // this happens if implicits are ambiguous; try again with more context info.
- // println("last ditch effort: "+qual+" . "+name)
- context.tree match {
- case Apply(tree1, args) if tree1 eq tree => // try handling the arguments
- // println("typing args: "+args)
- silent(_.typedArgs(args, mode)) match {
- case args: List[_] =>
- adaptToArguments(qual, name, args.asInstanceOf[List[Tree]], WildcardType)
- case _ =>
- throw ex
- }
- case _ =>
- // println("not in an apply: "+context.tree+"/"+tree)
- throw ex
- }
- }
+ val qual1 =
+ if (member(qual, name) != NoSymbol) qual
+ else adaptToMemberWithArgs(tree, qual, name, mode)
if (qual1 ne qual) return typed(treeCopy.Select(tree, qual1, name), mode, pt)
}
@@ -3567,6 +3574,12 @@ trait Typers extends Modes {
qual // you only get to see the wrapped tree after running this check :-p
}) setType qual.tpe,
name)
+ case accErr: Inferencer#AccessError =>
+ val qual1 =
+ try adaptToMemberWithArgs(tree, qual, name, mode)
+ catch { case _: TypeError => qual }
+ if (qual1 ne qual) typed(Select(qual1, name) setPos tree.pos, mode, pt)
+ else accErr.emit()
case _ =>
result
}
@@ -3713,10 +3726,10 @@ trait Typers extends Modes {
if (inaccessibleSym eq NoSymbol) {
error(tree.pos, "not found: "+decodeWithKind(name, context.owner))
}
- else accessError(
+ else new AccessError(
tree, inaccessibleSym, context.enclClass.owner.thisType,
inaccessibleExplanation
- )
+ ).emit()
defSym = context.owner.newErrorSymbol(name)
}
}
diff --git a/src/library/scala/sys/process/ProcessBuilder.scala b/src/library/scala/sys/process/ProcessBuilder.scala
index 84a176b26d..0e34e7be1b 100644
--- a/src/library/scala/sys/process/ProcessBuilder.scala
+++ b/src/library/scala/sys/process/ProcessBuilder.scala
@@ -81,12 +81,6 @@ trait ProcessBuilder extends Source with Sink {
* redirections (implemented as pipes) from masking useful process error codes.
*/
def hasExitValue: Boolean
-
- /** Constructs a new builder which runs this command with all input/output threads marked
- * as daemon threads. This allows the creation of a long running process while still
- * allowing the JVM to exit normally.
- */
- def daemonized(): ProcessBuilder
}
object ProcessBuilder extends ProcessBuilderImpl {
diff --git a/src/library/scala/sys/process/ProcessBuilderImpl.scala b/src/library/scala/sys/process/ProcessBuilderImpl.scala
index 4f6d5211f3..58f06e1039 100644
--- a/src/library/scala/sys/process/ProcessBuilderImpl.scala
+++ b/src/library/scala/sys/process/ProcessBuilderImpl.scala
@@ -81,7 +81,7 @@ private[process] trait ProcessBuilderImpl {
override def canPipeTo = true
}
- private[process] abstract class AbstractBuilder extends ProcessBuilder with Sink with Source {
+ private[scala] abstract class AbstractBuilder extends ProcessBuilder with Sink with Source {
protected def toSource = this
protected def toSink = this
@@ -114,6 +114,13 @@ private[process] trait ProcessBuilderImpl {
def !< = run(true).exitValue()
def !<(log: ProcessLogger) = runBuffered(log, true)
+ /** Constructs a new builder which runs this command with all input/output threads marked
+ * as daemon threads. This allows the creation of a long running process while still
+ * allowing the JVM to exit normally.
+ *
+ * Note: not in the public API because it's not fully baked, but I need the capability
+ * for fsc.
+ */
def daemonized(): ProcessBuilder = new DaemonBuilder(this)
private[this] def slurp(log: Option[ProcessLogger], withIn: Boolean): String = {
diff --git a/test/files/pos/t4402/A.scala b/test/files/pos/t4402/A.scala
new file mode 100644
index 0000000000..f43f0865f0
--- /dev/null
+++ b/test/files/pos/t4402/A.scala
@@ -0,0 +1,3 @@
+package ohmy
+
+class A extends other.Bar
diff --git a/test/files/pos/t4402/Bar.java b/test/files/pos/t4402/Bar.java
new file mode 100644
index 0000000000..edc00a5fd1
--- /dev/null
+++ b/test/files/pos/t4402/Bar.java
@@ -0,0 +1,7 @@
+package other;
+
+public class Bar extends test.Foo {
+ void createMeSth(test.Foo.Inner aaa) {
+ aaa.hello();
+ }
+}
diff --git a/test/files/pos/t4402/Foo.java b/test/files/pos/t4402/Foo.java
new file mode 100644
index 0000000000..585a5e0a2c
--- /dev/null
+++ b/test/files/pos/t4402/Foo.java
@@ -0,0 +1,8 @@
+package test;
+
+public abstract class Foo {
+ protected interface Inner {
+ public void hello();
+ }
+}
+
diff --git a/test/pending/run/t4283/AbstractFoo.java b/test/pending/run/t4283/AbstractFoo.java
new file mode 100644
index 0000000000..6d4e8f4e22
--- /dev/null
+++ b/test/pending/run/t4283/AbstractFoo.java
@@ -0,0 +1,5 @@
+package test;
+
+/* package private */ class AbstractFoo {
+ public int t;
+} \ No newline at end of file
diff --git a/test/pending/run/t4283/IllegalAccess.scala b/test/pending/run/t4283/IllegalAccess.scala
new file mode 100644
index 0000000000..e1bce15cf8
--- /dev/null
+++ b/test/pending/run/t4283/IllegalAccess.scala
@@ -0,0 +1,5 @@
+package other
+
+object IllegalAccess {
+ val x = (new test.ScalaBipp).make.get.t // java.lang.IllegalAccessError: tried to access class test.AbstractFoo from class other.IllegalAccess$
+}
diff --git a/test/pending/run/t4283/ScalaBipp.scala b/test/pending/run/t4283/ScalaBipp.scala
new file mode 100644
index 0000000000..36dea9f4de
--- /dev/null
+++ b/test/pending/run/t4283/ScalaBipp.scala
@@ -0,0 +1,5 @@
+package test
+
+class ScalaBipp extends AbstractFoo {
+ def make: Option[ScalaBipp] = Option(this)
+}
diff --git a/test/scaladoc/scala/html/HtmlFactoryTest.scala b/test/scaladoc/scala/html/HtmlFactoryTest.scala
index c0a3f1ad95..15f5249c90 100644
--- a/test/scaladoc/scala/html/HtmlFactoryTest.scala
+++ b/test/scaladoc/scala/html/HtmlFactoryTest.scala
@@ -266,4 +266,12 @@ object Test extends Properties("HtmlFactory") {
case _ => false
}
}
+
+ property("Trac #4452") = {
+ createTemplate("Trac4452.scala") match {
+ case node: scala.xml.Node =>
+ ! node.toString.contains(">*")
+ case _ => false
+ }
+ }
}