diff options
author | Lukas Rytz <lukas.rytz@gmail.com> | 2015-07-02 16:11:50 +0200 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@gmail.com> | 2015-07-02 16:21:28 +0200 |
commit | c42428d76652cbf3ffda1204b8f2e7bb5654f119 (patch) | |
tree | a6f02d584cf1e032bcb4fe69d9699e5b149e5c68 /test/files/run/reify_csv.scala | |
parent | 743b7297566e9a431e361388c85475deecb71c5e (diff) | |
download | scala-c42428d76652cbf3ffda1204b8f2e7bb5654f119.tar.gz scala-c42428d76652cbf3ffda1204b8f2e7bb5654f119.tar.bz2 scala-c42428d76652cbf3ffda1204b8f2e7bb5654f119.zip |
Fix superclass for Java interface symbols created in JavaMirrors
According to the spec [1] the superclass of an interface is always
Object.
Restores the tests that were moved to pending in bf951ec1,
fixex part of SI-9374.
[1] https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.1
Diffstat (limited to 'test/files/run/reify_csv.scala')
-rw-r--r-- | test/files/run/reify_csv.scala | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/files/run/reify_csv.scala b/test/files/run/reify_csv.scala new file mode 100644 index 0000000000..c35624469c --- /dev/null +++ b/test/files/run/reify_csv.scala @@ -0,0 +1,36 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends App { + val csv = """ + | phase name; id; description + | parser; 1; parse source into ASTs, perform simple desugaring + | namer; 2; resolve names, attach symbols to named trees + |packageobjects; 3; load package objects + | typer; 4; the meat and potatoes: type the trees + |superaccessors; 5; add super accessors in traits and nested classes + | pickler; 6; serialize symbol tables + | refchecks; 7; reference/override checking, translate nested objects + | selectiveanf; 8; + | liftcode; 9; reify trees""".stripMargin.split("\n").map{_.trim()}.drop(1).toList + + val fields = csv.head.split(";").map{_.trim()}.toList + println(fields) + + reify({ + object Csv { + case class record(`phase name`: String, id: String, description: String) + + object record { + def parse(lines: List[String]) = { + lines drop(1) map { line => line.split(";", -1).toList match { + case phase$whitespace$name :: id :: description :: _ => record(phase$whitespace$name.trim(), id.trim(), description.trim()) + case _ => throw new Exception("format error") + }} + } + } + } + + Csv.record.parse(csv) foreach println + }).eval +} |