Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #import("dart:coreimpl");
- class UnderScore {
- var _overloads;
- UnderScore() {
- _overloads = {
- 'test': { '2':this._test_two }
- };
- }
- noSuchMethod(String function_name, Array args) {
- var func = _overloads[function_name][args.length.toString()];
- func(args);
- }
- test( arg1 ) {
- print( "Called test(${arg1})" );
- }
- _test_two( args ) {
- print( "Called _test_two(${args[0]} ,${args[1]})" );
- }
- }
- main() {
- var _ = new UnderScore();
- _.test(1);
- _.test(1,2);
- }
Add Comment
Please, Sign In to add comment