From bc16b290ba6c2168baf1153b4c7691e679f68b46 Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Sun, 2 Jul 2017 22:08:39 +0100 Subject: Disable polymorphic overloading in the global scope TODO: Figure out why it does not work in the global scope --- code/demo.odin | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'code') diff --git a/code/demo.odin b/code/demo.odin index cba0212fb..4b9c27a15 100644 --- a/code/demo.odin +++ b/code/demo.odin @@ -364,9 +364,17 @@ explicit_parametric_polymorphic_procedures :: proc() { } } + main :: proc() { - general_stuff(); + foo :: proc(x: i64, y: f32) do fmt.println("#1", x, y); + foo :: proc(x: type, y: f32) do fmt.println("#2", type_info(x), y); + foo :: proc(x: type) do fmt.println("#3", type_info(x)); + + foo(y = 3785.1546, x = 123); + foo(x = int, y = 897.513); + foo(x = f32); /* + general_stuff(); foreign_blocks(); default_arguments(); named_arguments(); @@ -376,7 +384,6 @@ main :: proc() { // Command line argument(s)! // -opt=0,1,2,3 -*/ program := "+ + * - /"; accumulator := 0; @@ -393,5 +400,9 @@ main :: proc() { fmt.printf("The program \"%s\" calculates the value %d\n", program, accumulator); +*/ } + + + -- cgit v1.2.3