Created
March 25, 2015 21:06
-
-
Save mraleph/98da08902093d158f464 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:mirrors'; | |
class Proxy { | |
static final getName = currentMirrorSystem().getName; | |
final target; | |
Proxy(this.target); | |
noSuchMethod(invocation) { | |
print("invoking ${invocation.memberName}"); | |
return reflect(target).delegate(invocation); | |
} | |
} | |
main() { | |
final a = new Proxy(1); | |
final b = new Proxy(2); | |
print("$a + $b = ${a + b}"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment