diff options
author | Martin Odersky <odersky@gmail.com> | 2006-11-16 14:22:08 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2006-11-16 14:22:08 +0000 |
commit | 466db7220a4325c84d43cc55c517d0cb8240310d (patch) | |
tree | faebfa44380e8ebea7f0609d55ccf5e369d44bfb /src | |
parent | cb7711db82c381848a6571047c68145e4f2d3c46 (diff) | |
download | scala-466db7220a4325c84d43cc55c517d0cb8240310d.tar.gz scala-466db7220a4325c84d43cc55c517d0cb8240310d.tar.bz2 scala-466db7220a4325c84d43cc55c517d0cb8240310d.zip |
fixed bug798, 800
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Namers.scala | 1 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 13 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala index c527bb981b..29af968d2a 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala @@ -335,6 +335,7 @@ trait Namers requires Analyzer { if (settings.debug.value) log("defining " + sym); val tp = typeSig(tree) sym.setInfo(tp) + if (sym.isType) typer.checkNonCyclic(sym) if (settings.debug.value) log("defined " + sym); validate(sym) } diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 1b1b1823a3..ff4c5f75d4 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -845,6 +845,8 @@ trait Typers requires Analyzer { val value = vdef.symbol val getter = if (mods hasFlag DEFERRED) value else value.getter(value.owner) assert(getter != NoSymbol, stat) + if (getter hasFlag OVERLOADED) + error(getter.pos, ""+getter+" is defined twice") val getterDef: DefDef = { val result = DefDef(getter, vparamss => if (mods hasFlag DEFERRED) EmptyTree @@ -855,11 +857,14 @@ trait Typers requires Analyzer { result } def setterDef: DefDef = { + val setr = getter.setter(value.owner) val result = atPos(vdef.pos)( - DefDef(getter.setter(value.owner), vparamss => - if (mods hasFlag DEFERRED) EmptyTree - else typed(Assign(Select(This(value.owner), value), - Ident(vparamss.head.head))))) + DefDef(setr, vparamss => + if ((mods hasFlag DEFERRED) || (setr hasFlag OVERLOADED)) + EmptyTree + else + typed(Assign(Select(This(value.owner), value), + Ident(vparamss.head.head))))) result.mods setAttr vdef.mods.attributes result } |