Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using System;
using System.Dynamic;
using System.Linq.Expressions;

class Evil : DynamicObject {
    static void Main() {
        dynamic cout = new Evil();
        var hacketyHackHack =
        cout << "abc" << "def";
    }

    public override bool TryBinaryOperation(BinaryOperationBinder binder, object arg, out object result) {
        switch(binder.Operation) {
            case ExpressionType.LeftShift:
            case ExpressionType.LeftShiftAssign:
                Console.WriteLine(arg); // or whatever you want to do
                result = this;
                return true;
        }
        return base.TryBinaryOperation(binder, arg, out result);
    }
}