aboutsummaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-07-02 22:08:39 +0100
committerGinger Bill <bill@gingerbill.org>2017-07-02 22:08:39 +0100
commitbc16b290ba6c2168baf1153b4c7691e679f68b46 (patch)
treeb18d799bde62c727111f042c0813a18e362e674a /code
parent96d32680fe1b83ec943382efb8e91c7029f0621f (diff)
Disable polymorphic overloading in the global scope
TODO: Figure out why it does not work in the global scope
Diffstat (limited to 'code')
-rw-r--r--code/demo.odin15
1 files changed, 13 insertions, 2 deletions
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);
+*/
}
+
+
+