Skip to content

Commit

Permalink
update check now that trait vals can be concrete, use names not letters
Browse files Browse the repository at this point in the history
note the progression in a concrete trait val now being recognized as such
```
-trait T => true
-method $init$ => false
-value z1 => true
-value z2 => true // z2 is actually concrete!
```
  • Loading branch information
adriaanm committed Oct 13, 2015
1 parent 255cc06 commit eae7dac
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 43 deletions.
52 changes: 26 additions & 26 deletions test/files/run/t7533.check
@@ -1,30 +1,30 @@
Testing Symbol.isAbstract...
=======class C=======
class C => true
constructor C => false
value x1 => true
value x2 => false
value x2 => false
method y1 => true
method y2 => false
type T1 => true
type T2 => false
class C => abstract
constructor C => concrete
value xAbs => abstract
value x => concrete
value x => concrete
method yAbs => abstract
method y => concrete
type TAbs => abstract
type T => concrete
=======trait T=======
trait T => true
method $init$ => false
value z1 => true
value z2 => true
method w1 => true
method w2 => false
type U1 => true
type U2 => false
method T$_setter_$z2_= => true
=======class D=======
class D => false
constructor D => false
value x1 => false
value x1 => false
method y1 => false
trait T => abstract
method $init$ => concrete
value zAbs => abstract
value z => concrete
method wAbs => abstract
method w => concrete
type UAbs => abstract
type U => concrete
method T$_setter_$z_= => abstract
=======class AllConcrete=======
class AllConcrete => concrete
constructor AllConcrete => concrete
value xAbs => concrete
value xAbs => concrete
method yAbs => concrete
=======object M=======
object M => false
constructor M => false
object M => concrete
constructor M => concrete
34 changes: 17 additions & 17 deletions test/files/run/t7533.scala
@@ -1,24 +1,24 @@
import scala.reflect.runtime.universe._

abstract class C {
val x1: Int
val x2: Int = 2
def y1: Int
def y2: Int = 2
type T1 <: Int
type T2 = Int
val xAbs: Int
val x: Int = 2
def yAbs: Int
def y: Int = 2
type TAbs <: Int
type T = Int
}
trait T {
val z1: Int
val z2: Int = 2
def w1: Int
def w2: Int = 2
type U1 <: Int
type U2 = Int
val zAbs: Int
val z: Int = 2
def wAbs: Int
def w: Int = 2
type UAbs <: Int
type U = Int
}
class D extends C {
val x1 = 3
def y1 = 3
class AllConcrete extends C {
val xAbs = 3
def yAbs = 3
}
object M

Expand All @@ -27,12 +27,12 @@ object Test extends App {
def test[T: TypeTag] = {
val sym = typeOf[T].typeSymbol
println(s"=======$sym=======")
def printAbstract(sym: Symbol) = println(s"$sym => ${sym.isAbstract}")
def printAbstract(sym: Symbol) = println(s"$sym => ${if (sym.isAbstract) "abstract" else "concrete"}")
printAbstract(sym)
sym.info.decls.sorted.foreach(printAbstract)
}
test[C]
test[T]
test[D]
test[AllConcrete]
test[M.type]
}

0 comments on commit eae7dac

Please sign in to comment.