summaryrefslogtreecommitdiffstats
path: root/tests/ui/fun-indirect-call.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/fun-indirect-call.rs')
-rw-r--r--tests/ui/fun-indirect-call.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/fun-indirect-call.rs b/tests/ui/fun-indirect-call.rs
new file mode 100644
index 000000000..49da3d83f
--- /dev/null
+++ b/tests/ui/fun-indirect-call.rs
@@ -0,0 +1,9 @@
+// run-pass
+
+fn f() -> isize { return 42; }
+
+pub fn main() {
+ let g: fn() -> isize = f;
+ let i: isize = g();
+ assert_eq!(i, 42);
+}