From 57688dea36e6d1f8d7bad255898d1e222b3a6fbc Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 6 Apr 2016 14:15:20 -0700 Subject: add error for gt and lt comparison of invalid types --- test/run_tests.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/run_tests.cpp') diff --git a/test/run_tests.cpp b/test/run_tests.cpp index fcec983db6..fb232aed70 100644 --- a/test/run_tests.cpp +++ b/test/run_tests.cpp @@ -1776,6 +1776,11 @@ fn f() { const foo = "a b"; )SOURCE", 1, ".tmp_source.zig:2:13: error: use raw string for multiline string literal"); + + add_compile_fail_case("invalid comparison for function pointers", R"SOURCE( +fn foo() {} +const invalid = foo > foo; + )SOURCE", 1, ".tmp_source.zig:3:21: error: operator not allowed for type 'fn()'"); } ////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3