*** empty log message ***

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@3054 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
odersky 2004-04-20 12:12:02 +00:00
parent 0e50f11a89
commit 4022ac2e22
3 changed files with 12 additions and 3 deletions

View File

@ -2060,7 +2060,16 @@ class Analyzer(global: scalac_Global, descr: AnalyzerPhase) extends Transformer(
if ((mode & TYPEmode) != 0) {
val sym: Symbol = tree1.symbol();
if ((mode & FUNmode) == 0 && sym != null && sym.typeParams().length != 0) {
def typeParamCount = sym.primaryConstructor().rawInfo() match {
case t: LazyTreeType =>
t.tree match {
case Tree$ClassDef(_, _, tparams, _, _, _) => tparams.length
case Tree$AliasTypeDef(_, _, tparams, _) => tparams.length
case _ => 0
}
case _ => sym.typeParams().length
}
if ((mode & FUNmode) == 0 && sym != null && typeParamCount != 0) {
error(tree.pos, "" + sym + " takes type parameters.");
return errorTree(tree);
}

View File

@ -3,7 +3,7 @@
** __\_ \/ /_/ / /__/ /_/ /\_ \ (c) 2002, LAMP/EPFL **
** /_____/\____/\___/\____/____/ **
**
** $Id$
\* */
//todo check significance of JAVA flag.

View File

@ -1,4 +1,4 @@
/home/odersky/scala/test/files/neg/Y.scala:3: `match' needs to be applied fully
Y.scala:3: `match' needs to be applied fully
def f(x: Object): java.lang.Object /* !!! Object */ = x.match;
^
one error found