Skip to content

Instantly share code, notes, and snippets.

@rightfold
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rightfold/658038c052a4b2875106 to your computer and use it in GitHub Desktop.
Save rightfold/658038c052a4b2875106 to your computer and use it in GitHub Desktop.
use std.io;
proc f(x: Unit, y: Anything) {
if x(x) { } else { };
}
proc g(x: io, y: f, z: Z32) {
if z { } else { };
}
proc main() {
if f("x", "y") { } else { };
f({ "x"; {}; }, f);
f({ "x"; }, "x");
f();
}
warning: callee is of type 'std.Unit', should be subroutine type
if x(x) { } else { };
^
warning: 'io' is a module, not a type
proc g(x: io, y: f, z: Z32) {
^
warning: 'f' is a subroutine, not a type
proc g(x: io, y: f, z: Z32) {
^
warning: condition is of type 'std.Z32', should be 'std.Boolean'
if z { } else { };
^
warning: argument is of type 'std.String', should be 'std.Unit'
if f("x", "y") { } else { };
^
warning: argument is of type 'std.String', should be 'std.Unit'
f({ "x"; }, "x");
^
warning: argument count is 0, should be 2
f();
^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment