diff options
author | Paul Phillips <paulp@improving.org> | 2011-04-28 16:26:05 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-04-28 16:26:05 +0000 |
commit | c5d9b7e6a99f253d6da941610c58d9d9e1a02925 (patch) | |
tree | 461c02007998ff775201b6860843b555f4ae3bfc /src/detach/plugin | |
parent | 199ec3c10fe7d2b2029ea8ae6a19240b46181435 (diff) | |
download | scala-c5d9b7e6a99f253d6da941610c58d9d9e1a02925.tar.gz scala-c5d9b7e6a99f253d6da941610c58d9d9e1a02925.tar.bz2 scala-c5d9b7e6a99f253d6da941610c58d9d9e1a02925.zip |
I wrote a warning when nullary methods return U...
I wrote a warning when nullary methods return Unit. I wimped out of
including it in this patch because we had about 200 of them, and that's
what is fixed in this patch. I will add the warning to some kind of
"-Xlint" feature after 2.9.
This is motivated at least partly by the resolution of #4506, which
indicates the distinction between "def foo()" and "def foo" will
continue to jab its pointy stick into our eyes, so I believe we have a
minimal duty of at least following our own advice about what they mean
and not making a semirandom choice as to whether a method has parens or
not. Review by community.
Diffstat (limited to 'src/detach/plugin')
-rw-r--r-- | src/detach/plugin/scala/tools/detach/Detach.scala | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/detach/plugin/scala/tools/detach/Detach.scala b/src/detach/plugin/scala/tools/detach/Detach.scala index 3ce8ef2fff..45342c96cf 100644 --- a/src/detach/plugin/scala/tools/detach/Detach.scala +++ b/src/detach/plugin/scala/tools/detach/Detach.scala @@ -756,7 +756,7 @@ abstract class Detach extends PluginComponent proxy } - def addAccessors { + def addAccessors() { def mkGetter(sym: Symbol, name: String): Symbol = { val getter = if (sym.isMethod) { val meth = sym.cloneSymbol(proxyIntf) @@ -1131,8 +1131,8 @@ abstract class Detach extends PluginComponent if (newDefs.isEmpty) stats1 else stats1 ::: newDefs } - private def genProxies { - def printDebugInfo { + private def genProxies() { + def printDebugInfo() { println("\ncompilation unit : "+unit) for ((sym, _) <- detachedClosure) { println("closure to detach: "+sym+" (owner: "+sym.owner+")") @@ -1155,7 +1155,7 @@ abstract class Detach extends PluginComponent println("\t"+sym+" -> "+xs.mkString(", ")+" ["+xs.length+"]") } } - def printDebugInfo2 { + def printDebugInfo2() { println("\nproxy classes :") for (sym <- proxies.keysIterator) println("\t"+sym+"("+sym.tpe+") -> "+proxies(sym)) |