bug fixes: 532, 531, 530
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@5776 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
parent
9fee5420ab
commit
6823c48a1e
|
@ -102,6 +102,8 @@ mixin class Codification requires Analyzer {
|
|||
case None =>
|
||||
if (sym.isRoot || sym.isRootPackage || sym.isEmptyPackageClass || sym.isEmptyPackage)
|
||||
reflect.RootSymbol
|
||||
else if (sym.owner.isTerm)
|
||||
reflect.NoSymbol
|
||||
else reify(sym.owner) match {
|
||||
case reflect.NoSymbol =>
|
||||
reflect.NoSymbol;
|
||||
|
@ -196,8 +198,8 @@ mixin class Codification requires Analyzer {
|
|||
def injectType(name: String): Tree = TypeTree(definitions.getClass(name).initialize.tpe);
|
||||
|
||||
def inject(value: Any): Tree = value match {
|
||||
case FreeValue(tree) =>
|
||||
tree
|
||||
case FreeValue(tree) =>
|
||||
New(Ident(definitions.getClass("scala.reflect.Literal")), List(List(tree)))
|
||||
case () => Literal(Constant(()))
|
||||
case x: String => Literal(Constant(x))
|
||||
case x: Boolean => Literal(Constant(x))
|
||||
|
|
|
@ -1181,6 +1181,7 @@ mixin class Typers requires Analyzer {
|
|||
error(arg.pos, "attribute argument needs to be a constant; found: "+arg)
|
||||
null
|
||||
})
|
||||
//case Block(
|
||||
}
|
||||
if (attrInfo != null) {
|
||||
val attributed =
|
||||
|
@ -1463,7 +1464,7 @@ mixin class Typers requires Analyzer {
|
|||
try {
|
||||
if (settings.debug.value) {
|
||||
assert(pt != null, tree);//debug
|
||||
//System.out.println("typing "+tree);//DEBUG
|
||||
System.out.println("typing "+tree);//DEBUG
|
||||
}
|
||||
val tree1 = if (tree.tpe != null) tree else typed1(tree, mode, pt)
|
||||
//System.out.println("typed "+tree1+":"+tree1.tpe);//debug
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
object Test extends Application {
|
||||
import scala.reflect._;
|
||||
def titi = {
|
||||
var truc = 0
|
||||
val tata: TypedCode[()=>Unit] = () => {
|
||||
truc = 6
|
||||
}
|
||||
()
|
||||
}
|
||||
}
|
|
@ -3,7 +3,7 @@ object Test extends Application {
|
|||
def titi: Unit = {
|
||||
var truc = 0
|
||||
val tata: TypedCode[()=>Unit] = () => {
|
||||
truc = 6
|
||||
truc = truc + 6
|
||||
}
|
||||
()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue