-
-
Save rightfold/658038c052a4b2875106 to your computer and use it in GitHub Desktop.
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
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(); | |
} |
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
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