From ab5a9360cf8871affd2e84eb25ab950452c6911f Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Tue, 28 Jul 2020 11:11:44 +0200 Subject: Reorder test module to restore the "invalid - valid" order. --- tests/errors/fused_types.pyx | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/tests/errors/fused_types.pyx b/tests/errors/fused_types.pyx index 6d9dd6879..b812b2977 100644 --- a/tests/errors/fused_types.pyx +++ b/tests/errors/fused_types.pyx @@ -49,6 +49,18 @@ def outer(cython.floating f): def inner(): cdef cython.floating g + +# Mixing const and non-const type makes fused type ambiguous +cdef fused mix_const_t: + int + const int + +cdef cdef_func_with_mix_const_type(mix_const_t val): + print(val) + +cdef_func_with_mix_const_type(1) + + # This is all valid dtype5 = fused_type(int, long, float) dtype6 = cython.fused_type(int, long) @@ -65,17 +77,6 @@ ctypedef fused fused2: func(x, y) -cdef fused mix_const_t: - int - const int - -cdef cdef_func_with_mix_const_type(mix_const_t val): - print(val) - -# Mixing const and non-const type makes fused type ambiguous -cdef_func_with_mix_const_type(1) - - _ERRORS = u""" 11:15: fused_type does not take keyword arguments 16:33: Type specified multiple times @@ -89,6 +90,6 @@ _ERRORS = u""" 40:0: Fused lambdas not allowed 43:5: Fused types not allowed here 46:9: Fused types not allowed here -76:0: Invalid use of fused types, type cannot be specialized -76:29: ambiguous overloaded method +61:0: Invalid use of fused types, type cannot be specialized +61:29: ambiguous overloaded method """ -- cgit v1.2.1