diff options
author | Martin Odersky <odersky@gmail.com> | 2003-03-10 11:55:36 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2003-03-10 11:55:36 +0000 |
commit | d5da7d9aa5a8d4833775454853e81ead20cc37a7 (patch) | |
tree | d48297de81cb6c84853b94ae02b6edabee5bce5f /sources/scalac/typechecker/Infer.java | |
parent | 1fb5a195b5575e7015be4fd1ee8f89116a78cfb5 (diff) | |
download | scala-d5da7d9aa5a8d4833775454853e81ead20cc37a7.tar.gz scala-d5da7d9aa5a8d4833775454853e81ead20cc37a7.tar.bz2 scala-d5da7d9aa5a8d4833775454853e81ead20cc37a7.zip |
*** empty log message ***
Diffstat (limited to 'sources/scalac/typechecker/Infer.java')
-rw-r--r-- | sources/scalac/typechecker/Infer.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sources/scalac/typechecker/Infer.java b/sources/scalac/typechecker/Infer.java index 2a5a638004..7423d0664d 100644 --- a/sources/scalac/typechecker/Infer.java +++ b/sources/scalac/typechecker/Infer.java @@ -71,8 +71,6 @@ public class Infer implements Modifiers, Kinds { /** Is type `tp' a parameterized method type? */ - /** Is type `tp' a parameterized method type? - */ boolean isParameterized(Type tp) { switch (tp) { case MethodType(_, _): return true; @@ -766,6 +764,15 @@ public class Infer implements Modifiers, Kinds { public void exprAlternative(Tree tree, Symbol[] alts, Type[] alttypes, Type pt) throws Type.Error { + if (alts.length > 0) { + int i = 0; + while (i < alts.length && + alts[i].isConstructor() && + alttypes[i] instanceof Type.MethodType) + i++; + if (i == alts.length) + throw new Type.Error("missing arguments for " + alts[0]); + } if (alts.length == 1) { tree.setSymbol(alts[0]).setType(alttypes[0]); return; |