Skip to content

Commit b6755f6

Browse files
committed
tests reorgs
Move some tests into proper slots + comments what they are.
1 parent 7d513b4 commit b6755f6

File tree

6 files changed

+35
-0
lines changed

6 files changed

+35
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package custom
2+
3+
import scala.tools.nsc._, reporters._, typechecker._
4+
5+
/** Demonstration of a custom Global with a custom Typer,
6+
* decoupled from trunk. Demonstration:
7+
*
8+
{{{
9+
scalac -d . CustomGlobal.scala && scala -nc -Yglobal-class custom.CustomGlobal \
10+
-e 'class Bippy(x: Int) ; def f = new Bippy(5)'
11+
12+
I'm typing a Bippy! It's a ClassDef.
13+
I'm typing a Bippy! It's a Ident.
14+
I'm typing a Bippy! It's a DefDef.
15+
}}}
16+
*
17+
*/
18+
class CustomGlobal(currentSettings: Settings, reporter: Reporter) extends Global(currentSettings, reporter) {
19+
override lazy val analyzer = new {
20+
val global: CustomGlobal.this.type = CustomGlobal.this
21+
} with Analyzer {
22+
override def newTyper(context: Context): Typer = new CustomTyper(context)
23+
24+
class CustomTyper(context : Context) extends Typer(context) {
25+
override def typed(tree: Tree, mode: Mode, pt: Type): Tree = {
26+
if (tree.summaryString contains "Bippy")
27+
println("I'm typing a Bippy! It's a " + tree.shortClass + ".")
28+
29+
super.typed(tree, mode, pt)
30+
}
31+
}
32+
}
33+
}

tests/pending/pos/annotations.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Needs an implementation of beanproperty to work
2+
13
class ann(i: Int) extends scala.annotation.Annotation
24
class cfann(x: String) extends annotation.ClassfileAnnotation
35

0 commit comments

Comments
 (0)