diff options
Diffstat (limited to 'tests/accept/compile/toverprc.nim')
-rwxr-xr-x | tests/accept/compile/toverprc.nim | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/tests/accept/compile/toverprc.nim b/tests/accept/compile/toverprc.nim deleted file mode 100755 index f35528ace..000000000 --- a/tests/accept/compile/toverprc.nim +++ /dev/null @@ -1,25 +0,0 @@ -# Test overloading of procs when used as function pointers - -import strutils - -proc parseInt(x: float): int = nil -proc parseInt(x: bool): int = nil -proc parseInt(x: float32): int = nil -proc parseInt(x: int8): int = nil -proc parseInt(x: TFile): int = nil -proc parseInt(x: char): int = nil -proc parseInt(x: int16): int = nil - -type - TParseInt = proc (x: string): int - -var - q = TParseInt(parseInt) - p: TParseInt = parseInt - -proc takeParseInt(x: proc (y: string): int): int = - result = x("123") - -echo "Give a list of numbers (separated by spaces): " -var x = stdin.readline.split.each(parseInt).max echo x, " is the maximum!" echo "another number: ", takeParseInt(parseInt) - |