Created
July 18, 2014 22:19
-
-
Save unixpickle/f5b00f4abffb5fe82abe to your computer and use it in GitHub Desktop.
Get function signature for main()
This file contains 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:io'; | |
typedef void EmptyFunc(); | |
typedef void OneFunc(List<String> _); | |
myMain1(List<String> _) { | |
} | |
myMain2() { | |
} | |
int getType(fn) { | |
if (fn is EmptyFunc) { | |
return 1; | |
} else { | |
return 2; | |
} | |
} | |
main() { | |
print(getType(myMain1)); | |
print(getType(myMain2)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment