Skip to content

Commit 915b26f

Browse files
committed
Merge pull request scala#1118 from scalamacros/ticket/6201
SI-6201 minor fixes in key points
2 parents 837a68b + 8d87387 commit 915b26f

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

src/reflect/scala/reflect/internal/Mirrors.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ trait Mirrors extends api.Mirrors {
247247
// is very beneficial for a handful of bootstrap symbols to have
248248
// first class identities
249249
sealed trait WellKnownSymbol extends Symbol {
250-
this initFlags TopLevelCreationFlags
250+
this initFlags (TopLevelCreationFlags | STATIC)
251251
}
252252
// Features common to RootClass and RootPackage, the roots of all
253253
// type and term symbols respectively.
@@ -276,7 +276,6 @@ trait Mirrors extends api.Mirrors {
276276

277277
override def isRoot = true
278278
override def isEffectiveRoot = true
279-
override def isStatic = true
280279
override def isNestedClass = false
281280
}
282281
// The empty package, which holds all top level types without given packages.

src/reflect/scala/reflect/internal/Trees.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ trait Trees extends api.Trees { self: SymbolTable =>
160160
new ThisSubstituter(clazz, to) transform this
161161

162162
def hasSymbolWhich(f: Symbol => Boolean) =
163-
hasSymbol && symbol != null && f(symbol)
163+
(symbol ne null) && (symbol ne NoSymbol) && f(symbol)
164164

165165
def isErroneous = (tpe ne null) && tpe.isErroneous
166166
def isTyped = (tpe ne null) && !tpe.isErroneous

test/files/pos/t6201.scala

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class Test {
2+
class Foo1 {
3+
def must(x: scala.xml.Elem) = ()
4+
}
5+
6+
class Foo2 {
7+
def must(x: Int) = ()
8+
}
9+
implicit def toFoo1(s: scala.xml.Elem) = new Foo1()
10+
implicit def toFoo2(s: scala.xml.Elem) = new Foo2()
11+
12+
def is: Unit = { (<a>{"a"}</a>).must(<a>{"b"}</a>) }
13+
}

0 commit comments

Comments
 (0)