summaryrefslogtreecommitdiff
path: root/sources/scalac
diff options
context:
space:
mode:
authormihaylov <mihaylov@epfl.ch>2005-10-04 07:26:37 +0000
committermihaylov <mihaylov@epfl.ch>2005-10-04 07:26:37 +0000
commitfba39a93283b8bc5116edd248a4a893c5fe9745c (patch)
tree416d9b8c12846e999c1b59902b0918e4f346ca2f /sources/scalac
parent2941c83b9539de394ca80ef85822f5950c09bb4e (diff)
downloadscala-fba39a93283b8bc5116edd248a4a893c5fe9745c.tar.gz
scala-fba39a93283b8bc5116edd248a4a893c5fe9745c.tar.bz2
scala-fba39a93283b8bc5116edd248a4a893c5fe9745c.zip
Removed the special handling of the += and -= m...
Removed the special handling of the += and -= methods for delegates. They are now treated as syntactic sugar and expanded by the analyzer
Diffstat (limited to 'sources/scalac')
-rw-r--r--sources/scalac/backend/msil/GenMSIL.java35
1 files changed, 1 insertions, 34 deletions
diff --git a/sources/scalac/backend/msil/GenMSIL.java b/sources/scalac/backend/msil/GenMSIL.java
index 73535cd3fb..3850369356 100644
--- a/sources/scalac/backend/msil/GenMSIL.java
+++ b/sources/scalac/backend/msil/GenMSIL.java
@@ -861,39 +861,6 @@ public final class GenMSIL {
return check(invokeMethod(sym, args, resType, true));
case Select(Tree qualifier, _):
- // Treat delegate chaining methods += and -= in a special way
- if(CLRTypes.instance().isDelegateType(tc.getType(qualifier.type())) &&
- (sym.name == Names.PLUSEQ || sym.name == Names.MINUSEQ)) {
- Type delegate = tc.getType(qualifier.type());
- MSILType delegateType = msilType(delegate);
- MethodBase chainer = tc.getMethod(sym);
-
- switch(qualifier) {
- case Apply(Tree f, _):
- Symbol setterSym = f.symbol().owner().lookup(
- Name.fromString(f.symbol().name.toString() +
- Names._EQ));
- assert !setterSym.isNone() : "Setter method not found";
- MethodInfo setter = (MethodInfo)tc.getMethod(setterSym);
-
- // Generate object and argument for the setter call
- emitThis(); // FIXME: doesn't work if the variable is
- // is a member of another class
- genLoad(qualifier, delegateType);
- invokeMethod(sym, args, delegateType, false);
- code.Emit(OpCodes.Castclass, delegate);
- code.Emit(OpCodes.Callvirt, setter);
- return items.VoidItem();
-
- case Ident(_):
- // Prepare the left-hand side for the store
- Item var = gen(qualifier, delegateType);
- load(var);
- invokeMethod(sym, args, delegateType, false);
- code.Emit(OpCodes.Castclass, delegate);
- return check(store(var));
- }
- }
// scala.Any.==
if (sym == defs.ANY_EQEQ) {
return genEq(qualifier, args[0]);
@@ -2375,7 +2342,7 @@ final class MSILType {
case REF(Type t):
if (t.IsEnum()) return fromType(t.getUnderlyingType());
else return this;
- case NULL:
+ //case NULL:
case ARRAY(_):
throw Debug.abort(this);
default: return this;