summaryrefslogtreecommitdiff
path: root/sources/scalac/typechecker/Infer.java
diff options
context:
space:
mode:
Diffstat (limited to 'sources/scalac/typechecker/Infer.java')
-rw-r--r--sources/scalac/typechecker/Infer.java11
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;