Ë
    èÿæi`>  ã                   ó   — d Z ddlZddlZddlZddlmZmZmZ ddl	m
Z
 ddlmZ ddlmZmZmZmZ ddlmZ ddlmZmZmZ dd	lmZmZmZmZ dd
lmZ ddlm Z! ddl"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z( ddl)Z) G d„ de)jP                  «      Z* G d„ de)jP                  «      Z+ G d„ de)jP                  «      Z, G d„ de)jP                  «      Z- G d„ de%e)jP                  «      Z. G d„ de%e(«      Z/ G d„ de)jP                  «      Z0e1dk(  r e)jd                  «        yy)z"
Unspecified error handling tests
é    N)ÚjitÚnjitÚtypes)Úerrors)Ú	structref)ÚoverloadÚ	intrinsicÚoverload_methodÚoverload_attribute)ÚCompilerBase)ÚTranslateByteCodeÚ	FixupArgsÚIRProcessing)ÚNopythonTypeInferenceÚDeadCodeEliminationÚNoPythonBackendÚNativeLowering)ÚPassManager)Ú_err_reasons)Úskip_parfors_unsupportedÚoverride_configÚSerialMixinÚskip_unless_cffiÚskip_unless_scipyÚTestCasec                   ó   — e Zd Zd„ Zy)ÚTestErrorHandlingBeforeLoweringc                 óþ   — d„ }t         t        fD ]_  }| j                  t        j                  «      5 }  ||«      d«       d d d «       d}| j                  |t        j                  «      «       Œa y # 1 sw Y   Œ3xY w)Nc                 ó   ‡— | dz   Šˆfd„}|S )z return the closure é   c                 ó   •— | ‰z   S ©N© )ÚxÚzs    €ús/Volumes/fast/ai/experiments/voice-extract-mac/.venv/lib/python3.12/site-packages/numba/tests/test_errorhandling.pyÚinnerzmTestErrorHandlingBeforeLowering.test_unsupported_make_function_return_inner_func.<locals>.func.<locals>.inner#   s   ø€ Ø˜1‘u�ó    r#   )r$   r'   r%   s     @r&   Úfuncz^TestErrorHandlingBeforeLowering.test_unsupported_make_function_return_inner_func.<locals>.func   s   ø€ à�A‘ˆAôàˆLr(   r    z%Cannot capture the non-constant value)r   r   ÚassertRaisesr   ÚTypingErrorÚassertInÚstrÚ	exception)Úselfr)   ÚpipelineÚraisesÚexpecteds        r&   Ú0test_unsupported_make_function_return_inner_funczPTestErrorHandlingBeforeLowering.test_unsupported_make_function_return_inner_func   sg   € ò	ô œT›	ˆHØ×"Ñ"¤6×#5Ñ#5Ô6¸&Ø‘˜“˜qÔ!÷ 7ð ?ˆHØ�M‰M˜(¤C¨×(8Ñ(8Ó$9Õ:ñ "ß6Ð6ús   ²A3Á3A<	N)Ú__name__Ú
__module__Ú__qualname__r3   r#   r(   r&   r   r      s   „ ó;r(   r   c                   ó   — e Zd Zd„ Zy)ÚTestUnsupportedReportingc                 óà   — t         d„ «       }| j                  t        j                  «      5 } |«        d d d «       d}| j	                  |t        j                  «      «       y # 1 sw Y   Œ1xY w)Nc                  ó2   — t        j                  g d¢«       y )N)r    é   é   )ÚnpÚ
asanyarrayr#   r(   r&   r)   zFTestUnsupportedReporting.test_unsupported_numpy_function.<locals>.func3   s   € ä�M‰Mš'Õ"r(   z4Use of unsupported NumPy function 'numpy.asanyarray'©r   r*   r   r+   r,   r-   r.   )r/   r)   r1   r2   s       r&   Útest_unsupported_numpy_functionz8TestUnsupportedReporting.test_unsupported_numpy_function1   s`   € ä	ñ	#ó 
ð	#ð ×Ñœv×1Ñ1Ô2°fÙŒF÷ 3ð JˆØ�‰�h¤ F×$4Ñ$4Ó 5Õ6÷	 3Ð2úó   ¬A$Á$A-N)r4   r5   r6   r@   r#   r(   r&   r8   r8   /   s   „ ó
7r(   r8   c                   óL   — e Zd Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Ze	d„ «       Z
d„ Zd	„ Zy
)ÚTestMiscErrorHandlingc                 óx   — t         d„ «       }t        j                  dgt        j                  ¬«      } ||«       y )Nc                 ó   — d| z  S ©Né
   r#   ©r$   s    r&   ÚfnzHTestMiscErrorHandling.test_use_of_exception_for_flow_control.<locals>.fnE   s   € à�q‘5ˆLr(   g      ð?)Údtype)r   r=   ÚarrayÚfloat64)r/   rI   Úas      r&   Ú&test_use_of_exception_for_flow_controlz<TestMiscErrorHandling.test_use_of_exception_for_flow_control@   s5   € ô
 
ñ	ó 
ð	ô �H‰H�c�U¤§¡Ô,ˆÙ
ˆ1�r(   c                 óÎ   — d„ }d„ }||fD ]L  }| j                  t        «      5 } |«        d d d «       | j                  dt        j                  «      «       ŒN y # 1 sw Y   Œ1xY w)Nc                  ó   — t        d«      ‚)NÚtest_string©Ú	Exceptionr#   r(   r&   Úfoo_commentedz_TestMiscErrorHandling.test_commented_func_definition_is_not_a_definition.<locals>.foo_commentedR   ó   € ä˜MÓ*Ð*r(   c                  ó   — t        d«      ‚)z> def docstring containing def might match function definition!rQ   rR   r#   r(   r&   Úfoo_docstringz_TestMiscErrorHandling.test_commented_func_definition_is_not_a_definition.<locals>.foo_docstringV   rU   r(   rQ   )r*   rS   r,   r-   r.   )r/   rT   rW   r)   r1   s        r&   Ú2test_commented_func_definition_is_not_a_definitionzHTestMiscErrorHandling.test_commented_func_definition_is_not_a_definitionL   sY   € ò	+ò	+ð # MÓ2ˆDØ×"Ñ"¤9Ô-°Ù”÷ .ð �M‰M˜-¬¨V×-=Ñ-=Ó)>Õ?ñ	 3ß-Ð-ús   £AÁA$	c                 ó"  —  G d„ dt         «      }t        |¬«      d„ «       }| j                  t        j                  «      5 } |t        ddg«      «       d d d «       d}| j                  |t        j                  «      «       y # 1 sw Y   Œ1xY w)Nc                   ó   — e Zd Zd„ Zy)úFTestMiscErrorHandling.test_use_of_ir_unknown_loc.<locals>.TestPipelinec                 óv  — d}t        |«      }|j                  t        d«       |j                  t        d«       |j                  t        d«       |j                  t
        d«       |j                  t        d«       |j                  t        d«       |j                  t        d«       |j                  «        |gS )	NÚbad_DCE_pipelinezanalyzing bytecodezfix up argszprocessing IRÚDCEznopython frontendznative loweringznopython mode backend)
r   Úadd_passr   r   r   r   r   r   r   Úfinalize)r/   ÚnameÚpms      r&   Údefine_pipelineszWTestMiscErrorHandling.test_use_of_ir_unknown_loc.<locals>.TestPipeline.define_pipelinesc   sŒ   € Ø)�Ü  Ó&�Ø—‘Ô-Ð/CÔDØ—‘œI }Ô5Ø—‘œL¨/Ô:ð —‘Ô/°Ô7à—‘Ô1Ð3FÔGØ—‘œNÐ,=Ô>Ø—‘œOÐ-DÔEØ—‘”Ø�t�r(   N)r4   r5   r6   rc   r#   r(   r&   ÚTestPipeliner[   b   s   „ ór(   rd   )Úpipeline_classc                  ó   — y)Nr   r#   ©rM   s    r&   Úfz;TestMiscErrorHandling.test_use_of_ir_unknown_loc.<locals>.fs   s   € àr(   r    r;   z File "unknown location", line 0:)	r   r   r*   r   r+   Úiterr,   r-   r.   )r/   rd   rh   r1   r2   s        r&   Útest_use_of_ir_unknown_locz0TestMiscErrorHandling.test_use_of_ir_unknown_loc`   s|   € ô	œ<ô 	ô" 
˜\Ô	*ñ	ó 
+ð	ð ×Ñœv×1Ñ1Ô2°fÙŒd�A�a�5‹kŒN÷ 3ð 6ˆØ�‰�h¤ F×$4Ñ$4Ó 5Õ6÷	 3Ð2ús   ÁBÂBc                 óÚ   — | j                  t        j                  «      5 } |«        d d d «       ddg}|D ]'  }| j                  |t	        j
                  «      «       Œ) y # 1 sw Y   Œ:xY w)NzThe use of az'in globals, is not supported as globals)r*   r   r+   r,   r-   r.   )r/   r)   r1   r2   Úexs        r&   Úcheck_write_to_globalsz,TestMiscErrorHandling.check_write_to_globals}   s[   € Ø×Ñœv×1Ñ1Ô2°fÙŒF÷ 3ð #Ð$MÐNˆÛˆBØ�M‰M˜"œc &×"2Ñ"2Ó3Õ4ñ ÷	 3Ð2ús    A!Á!A*c                 óD   — ddl m} | j                  t        |«      «       y )Nr   )Úglobal_reflected_write)Ú"numba.tests.errorhandling_usecasesro   rm   r   )r/   ro   s     r&   Ú*test_handling_of_write_to_reflected_globalz@TestMiscErrorHandling.test_handling_of_write_to_reflected_global…   s   € ÝMØ×#Ñ#¤DÐ)?Ó$@ÕAr(   c                 óD   — ddl m} | j                  t        |«      «       y )Nr   )Úglobal_dict_write)rp   rs   rm   r   )r/   rs   s     r&   Ú+test_handling_of_write_to_typed_dict_globalzATestMiscErrorHandling.test_handling_of_write_to_typed_dict_global‰   s   € ÝHØ×#Ñ#¤DÐ):Ó$;Õ<r(   c                 óì   — t        d¬«      d„ «       }| j                  t        j                  «      5 } |«        d d d «       d}| j	                  |t        j                  «      «       y # 1 sw Y   Œ1xY w)NT)Úparallelc                  ó$   — t        d«      D ]  } Œ y rF   )Úprange)Úis    r&   ÚfoozPTestMiscErrorHandling.test_handling_forgotten_numba_internal_import.<locals>.foo�   s   € ä˜B–Z�Øñ  r(   zC'prange' looks like a Numba internal function, has it been importedr?   )r/   rz   r1   r2   s       r&   Ú-test_handling_forgotten_numba_internal_importzCTestMiscErrorHandling.test_handling_forgotten_numba_internal_import�   sd   € ä	�tÔ	ñ	ó 
ð	ð ×Ñœv×1Ñ1Ô2°fÙŒE÷ 3ð+ˆà�‰�h¤ F×$4Ñ$4Ó 5Õ6÷ 3Ð2ús   ²A*Á*A3c                 ó  — d„ }d}t        d¬«      t        fD ]\  }| j                  t        j                  «      5 }  ||«      «        d d d «       | j                  |t        j                  «      «       Œ^ y # 1 sw Y   Œ1xY w)Nc                  ó(   — d„ t        d«      D «        y )Nc              3   ó    K  — | ]  }|–— Œ y ­wr"   r#   )Ú.0r$   s     r&   Ú	<genexpr>zdTestMiscErrorHandling.test_handling_unsupported_generator_expression.<locals>.foo.<locals>.<genexpr>�   s   è ø€ Ð"™	�1ŒQ™	ùs   ‚rG   )Úranger#   r(   r&   rz   zQTestMiscErrorHandling.test_handling_unsupported_generator_expression.<locals>.fooœ   s   € Ù"œ˜bœ	Õ"r(   z-The use of yield in a closure is unsupported.T)Úforceobj)r   r   r*   r   ÚUnsupportedErrorr,   r-   r.   )r/   rz   r2   Údecr1   s        r&   Ú.test_handling_unsupported_generator_expressionzDTestMiscErrorHandling.test_handling_unsupported_generator_expression›   si   € ò	#ð Cˆä Ô%¤tÓ+ˆCØ×"Ñ"¤6×#:Ñ#:Ô;¸vØ‘�C“”
÷ <à�M‰M˜(¤C¨×(8Ñ(8Ó$9Õ:ñ ,ß;Ð;ús   ºA8Á8B	c                 óà   — t         d„ «       }d}| j                  t        j                  «      5 } |«        d d d «       | j	                  |t        j                  «      «       y # 1 sw Y   Œ/xY w)Nc                  ó   — t         S r"   rg   r#   r(   r&   rz   zCTestMiscErrorHandling.test_handling_undefined_variable.<locals>.foo§   s   € äˆHr(   z"NameError: name 'a' is not definedr?   )r/   rz   r2   r1   s       r&   Ú test_handling_undefined_variablez6TestMiscErrorHandling.test_handling_undefined_variable¦   s]   € Ü	ñ	ó 
ð	ð 8ˆà×Ñœv×1Ñ1Ô2°fÙŒE÷ 3à�‰�h¤ F×$4Ñ$4Ó 5Õ6÷ 3Ð2ús   ®A$Á$A-N)r4   r5   r6   rN   rX   rj   rm   rq   rt   r   r{   r…   rˆ   r#   r(   r&   rC   rC   >   s@   „ ò
ò@ò(7ò:5òBò=ð ñ7ó ð7ò	;ó	7r(   rC   c                   ón   — e Zd Zd„ Zd„ Zed„ «       Zd„ Zd„ Zd„ Z	d„ Z
d„ Zd	„ Zd
„ Zd„ Zed„ «       Zd„ Zy)ÚTestErrorMessagesc                 ól  ‡‡— dŠd„ Št        ‰«      ˆfd„«       }t        ˆfd„«       }| j                  t        j                  «      5 } |«        d d d «       t        j                  «      }| j                  t        d   j                  «       d   |«       | j                  ‰|«       y # 1 sw Y   Œ[xY w)NÚspecific_reasonc                   ó   — y r"   r#   r#   r(   r&   rz   z2TestErrorMessages.test_specific_error.<locals>.foo¸   ó   € Ør(   c                  ó.   •— t        j                  ‰ «      ‚r"   )r   ÚNumbaValueError)Úgiven_reasons   €r&   Úol_fooz5TestErrorMessages.test_specific_error.<locals>.ol_foo»   s   ø€ ä×(Ñ(¨Ó6Ð6r(   c                  ó   •—  ‰ «        y r"   r#   ©rz   s   €r&   Úcall_fooz7TestErrorMessages.test_specific_error.<locals>.call_foo¿   ó   ø€ á�Er(   Úspecific_errorr   )
r   r   r*   r   r+   r-   r.   r,   Úerror_reasonsÚ
splitlines)r/   r’   r•   r1   Úexcstrrz   r‘   s        @@r&   Útest_specific_errorz%TestErrorMessages.test_specific_error´   s¦   ù€ à(ˆò	ô 
�#‹ó	7ó 
ð	7ô 
ó	ó 
ð	ð ×Ñœv×1Ñ1Ô2°fÙŒJ÷ 3ô �V×%Ñ%Ó&ˆØ�‰”mÐ$4Ñ5×@Ñ@ÓBÀ1ÑEÀvÔNØ�‰�l FÕ+÷ 3Ð2ús   ÁB*Â*B3c                 ó  ‡— d„ Št        ‰«      d„ «       }t        ˆfd„«       }| j                  t        j                  «      5 } |«        d d d «       t        j                  «      }| j                  d|«       y # 1 sw Y   Œ1xY w)Nc                   ó   — y r"   r#   r#   r(   r&   rz   z2TestErrorMessages.test_no_match_error.<locals>.fooÌ   rŽ   r(   c                   ó   — y r"   r#   r#   r(   r&   r’   z5TestErrorMessages.test_no_match_error.<locals>.ol_fooÏ   s   € àr(   c                  ó   •—  ‰ «        y r"   r#   r”   s   €r&   r•   z7TestErrorMessages.test_no_match_error.<locals>.call_fooÓ   r–   r(   zNo match)r   r   r*   r   r+   r-   r.   r,   )r/   r’   r•   r1   rš   rz   s        @r&   Útest_no_match_errorz%TestErrorMessages.test_no_match_errorÊ   s   ø€ ò	ô 
�#‹ñ	ó 
ð	ô 
ó	ó 
ð	ð ×Ñœv×1Ñ1Ô2°fÙŒJ÷ 3ô �V×%Ñ%Ó&ˆØ�‰�j &Õ)÷	 3Ð2ús   ÁA;Á;Bc                 ó   — t         d„ «       }| j                  t        j                  «      5 } |«        ddd«       t	        j
                  «      }| j                  t        d   j                  «       d   |«       t        j                  j                  ddd«      }d|› d	�}| j                  |j                  |«      |«       y# 1 sw Y   Œ‘xY w)
z¨ Checks that the reported source location for an overload is the
        overload implementation source, not the actual function source from the
        target library.c                  óB   — t         j                  j                  d«       y )NÚchars)r=   ÚlinalgÚsvdr#   r(   r&   rz   zDTestErrorMessages.test_error_function_source_is_correct.<locals>.fooã   s   € ä�I‰I�M‰M˜'Õ"r(   Nr—   r   Únumbar=   z	linalg.pyz'Overload in function 'svd_impl': File: Ú:)r   r*   r   r+   r-   r.   r,   r˜   r™   ÚosÚpathÚjoinÚformat)r/   rz   r1   rš   Úexpected_filer2   s         r&   Ú%test_error_function_source_is_correctz7TestErrorMessages.test_error_function_source_is_correctÝ   s°   € ô 
ñ	#ó 
ð	#ð ×Ñœv×1Ñ1Ô2°fÙŒE÷ 3ô �V×%Ñ%Ó&ˆØ�‰”mÐ$4Ñ5×@Ñ@ÓBÀ1ÑEÀvÔNÜŸ™Ÿ™ W¨d°KÓ@ˆØ<¸]¸OÈ1ÐMˆØ�‰�h—o‘o mÓ4°fÕ=÷ 3Ð2ús   ¬CÃCc                 ó  — t         d„ «       }| j                  t        j                  «      5 } |«        d d d «       t	        j
                  «      }| j                  d|«       | j                  d|«       y # 1 sw Y   ŒCxY w)Nc                  ó   — ddz   S )NrM   r    r#   r#   r(   r&   rz   z<TestErrorMessages.test_concrete_template_source.<locals>.fooò   s   € à˜‘7ˆNr(   zOverload of function 'add'ú	No match.©r   r*   r   r+   r-   r.   r,   ©r/   rz   r1   rš   s       r&   Útest_concrete_template_sourcez/TestErrorMessages.test_concrete_template_sourceð   sp   € ä	ñ	ó 
ð	ð ×Ñœv×1Ñ1Ô2°fÙŒE÷ 3ô �V×%Ñ%Ó&ˆà�‰Ð2°FÔ;ð 	�‰�k 6Õ*÷ 3Ð2ús   ¬A6Á6A?c                 óà   — t         d„ «       }| j                  t        j                  «      5 } |«        d d d «       t	        j
                  «      }| j                  d|«       y # 1 sw Y   Œ1xY w)Nc                  ó   — t        d«      S ©Nr    )Úlenr#   r(   r&   rz   z<TestErrorMessages.test_abstract_template_source.<locals>.foo  s   € ä�q“6ˆMr(   zOverload of function 'len'r±   r²   s       r&   Útest_abstract_template_sourcez/TestErrorMessages.test_abstract_template_source   s`   € ä	ñ	ó 
ð	ð ×Ñœv×1Ñ1Ô2°fÙŒE÷ 3ô �V×%Ñ%Ó&ˆØ�‰Ð2°FÕ;÷	 3Ð2úrA   c                 óà   — t         d„ «       }| j                  t        j                  «      5 } |«        d d d «       t	        j
                  «      }| j                  d|«       y # 1 sw Y   Œ1xY w)Nc                  ó,   — t        j                  d «      S r"   )r=   Úangler#   r(   r&   rz   z<TestErrorMessages.test_callable_template_source.<locals>.foo  s   € ä—8‘8˜D“>Ð!r(   z6No implementation of function Function(<function angler±   r²   s       r&   Útest_callable_template_sourcez/TestErrorMessages.test_callable_template_source  sc   € ä	ñ	"ó 
ð	"ð ×Ñœv×1Ñ1Ô2°fÙŒE÷ 3ô �V×%Ñ%Ó&ˆØ�‰ÐNØõ	÷	 3Ð2úrA   c                 óÂ  ‡— d„ Št        ‰«      d„ «       }t        ˆfd„«       }| j                  t        j                  «      5 } |«        d d d «       t        j                  «      }| j                  d|«       t        j                  j                  ddd«      }d|› d	�}| j                  |j                  |«      |«       | j                  d
|«       y # 1 sw Y   Œ‹xY w)Nc                  ó   — y r"   r#   rH   s    r&   ÚbarzDTestErrorMessages.test_overloadfunction_template_source.<locals>.bar  rŽ   r(   c                  ó   — y r"   r#   rH   s    r&   Úol_barzGTestErrorMessages.test_overloadfunction_template_source.<locals>.ol_bar  ó   € àr(   c                  ó   •—  ‰ d«      S r¶   r#   )r¿   s   €r&   rz   zDTestErrorMessages.test_overloadfunction_template_source.<locals>.foo"  s   ø€ á�q“6ˆMr(   z
<numerous>r¦   Útestsztest_errorhandling.pyz"Overload of function 'bar': File: r§   r°   )r   r   r*   r   r+   r-   r.   ÚassertNotInr¨   r©   rª   r,   r«   )r/   rÁ   rz   r1   rš   r¬   Úexpected_olr¿   s          @r&   Ú%test_overloadfunction_template_sourcez7TestErrorMessages.test_overloadfunction_template_source  sÑ   ø€ ò	ô 
�#‹ñ	ó 
ð	ô 
ó	ó 
ð	ð ×Ñœv×1Ñ1Ô2°fÙŒE÷ 3ô �V×%Ñ%Ó&ˆð 	×Ñ˜ vÔ.ÜŸ™Ÿ™ W¨gØ%<ó>ˆà:¸=¸/ÈÐKˆØ�‰�k×(Ñ(¨Ó7¸Ô@Ø�‰�k 6Õ*÷ 3Ð2ús   ÁCÃCc                 ó¬  ‡‡‡— dŠdŠt         ˆˆfd„«       Št        ˆfd„«       }| j                  t        j                  «      5 } |«        d d d «       t        j                  «      }| j                  t        d   j                  «       d   |«       | j                  ‰|«       | j                  ‰|«       | j                  d|«       y # 1 sw Y   ŒxY w)Nzx must be literalzarray.ndim must be 1c                 óä   •— t        |t        j                  «      st        j                  ‰«      ‚|j
                  dk7  rt        j                  ‰«      ‚t        j                  ||«      }d„ }||fS )Nr    c                  ó   — y r"   r#   )ÚcontextÚbuilderÚ	signatureÚargss       r&   ÚcodegenzSTestErrorMessages.test_intrinsic_template_source.<locals>.myintrin.<locals>.codegenB  ó   € Ør(   )Ú
isinstancer   ÚIntegerLiteralr   ÚRequireLiteralValueÚndimr�   Úintp)Ú	typingctxr$   ÚarrÚsigrÏ   Úgiven_reason1Úgiven_reason2s        €€r&   ÚmyintrinzBTestErrorMessages.test_intrinsic_template_source.<locals>.myintrin8  s_   ø€ ä˜a¤×!5Ñ!5Ô6Ü×0Ñ0°Ó?Ð?à�x‰x˜1Š}Ü×,Ñ,¨]Ó;Ð;ä—*‘*˜Q Ó$ˆCòà˜�<Ðr(   c                  óB   •— t        j                  d«      }  ‰d| «       y )N)r;   r;   r    )r=   Úzeros)r×   rÛ   s    €r&   Úcall_intrinzETestErrorMessages.test_intrinsic_template_source.<locals>.call_intrinF  s   ø€ ä—(‘(˜6Ó"ˆCÙ�Q˜Õr(   r—   r   zIntrinsic in function)
r	   r   r*   r   r+   r-   r.   r,   r˜   r™   )r/   rÞ   r1   rš   rÙ   rÚ   rÛ   s       @@@r&   Útest_intrinsic_template_sourcez0TestErrorMessages.test_intrinsic_template_source3  s½   ú€ à+ˆØ.ˆä	ô	 ó 
ð	 ô 
ó	ó 
ð	ð ×Ñœv×1Ñ1Ô2°fÙŒM÷ 3ô �V×%Ñ%Ó&ˆØ�‰”mÐ$4Ñ5×@Ñ@ÓBÀ1ÑEÀvÔNØ�‰�m VÔ,Ø�‰�m VÔ,Ø�‰Ð-¨vÕ6÷ 3Ð2ús   ÁC
Ã
Cc                 ó   — t        t        j                  d«      d„ «       }t        d„ «       }| j	                  t
        j                  «      5 } |«        d d d «       t        j                  «      }| j                  d|«       y # 1 sw Y   Œ1xY w)NÚ
isnonsensec                  ó   — y r"   r#   ©r/   s    r&   Úol_unicode_isnonsensezTTestErrorMessages.test_overloadmethod_template_source.<locals>.ol_unicode_isnonsenseW  rÂ   r(   c                  ó$   — dj                  «        y ©NÚabc©rá   r#   r(   r&   rz   zBTestErrorMessages.test_overloadmethod_template_source.<locals>.foo[  s   € à×ÑÕr(   ú,Overload of function 'ol_unicode_isnonsense')
r
   r   ÚUnicodeTyper   r*   r   r+   r-   r.   r,   ©r/   rä   rz   r1   rš   s        r&   Ú#test_overloadmethod_template_sourcez5TestErrorMessages.test_overloadmethod_template_sourceT  sƒ   € ô 
œ×*Ñ*¨LÓ	9ñ	ó 
:ð	ô 
ñ	ó 
ð	ð ×Ñœv×1Ñ1Ô2°fÙŒE÷ 3ô �V×%Ñ%Ó&ˆØ�‰ÐDÀfÕM÷	 3Ð2úó   ÁBÂBc                 ó   — t        t        j                  d«      d„ «       }t        d„ «       }| j	                  t
        j                  «      5 } |«        d d d «       t        j                  «      }| j                  d|«       y # 1 sw Y   Œ1xY w)Nrá   c                  ó   — y r"   r#   rã   s    r&   rä   zWTestErrorMessages.test_overloadattribute_template_source.<locals>.ol_unicode_isnonsenseh  rÂ   r(   c                  ó   — dj                    y ræ   rè   r#   r(   r&   rz   zETestErrorMessages.test_overloadattribute_template_source.<locals>.fool  s   € à×Ór(   ré   )
r   r   rê   r   r*   r   r+   r-   r.   r,   rë   s        r&   Ú&test_overloadattribute_template_sourcez8TestErrorMessages.test_overloadattribute_template_sourcee  sƒ   € ô 
œE×-Ñ-¨|Ó	<ñ	ó 
=ð	ô 
ñ	ó 
ð	ð ×Ñœv×1Ñ1Ô2°fÙŒE÷ 3ô �V×%Ñ%Ó&ˆØ�‰ÐDÀfÕM÷	 3Ð2úrí   c                 óò   ‡— ddl mŠ t        ˆfd„«       }| j                  t        j
                  «      5 } |«        d d d «       t        j                  «      }| j                  d|«       y # 1 sw Y   Œ1xY w)Nr   ©Úc_cosc                  ó   •—  ‰ d«       y ©NrM   r#   ró   s   €r&   rz   zMTestErrorMessages.test_external_function_pointer_template_source.<locals>.fooy  s
   ø€ á�#�Jr(   ú.Type Restricted Function in function 'unknown')	Únumba.tests.ctypes_usecasesrô   r   r*   r   r+   r-   r.   r,   )r/   rz   r1   rš   rô   s       @r&   Ú.test_external_function_pointer_template_sourcez@TestErrorMessages.test_external_function_pointer_template_sourcev  sd   ø€ Ý5ä	ó	ó 
ð	ð ×Ñœv×1Ñ1Ô2°fÙŒE÷ 3ô �V×%Ñ%Ó&ˆØ�‰ÐFÈÕO÷	 3Ð2ús   µA-Á-A6c                 ó*  ‡— ddl m} |j                  «        |j                  Št        ˆfd„«       }| j                  t        j                  «      5 } |«        d d d «       t        j                  «      }| j                  d|«       y # 1 sw Y   Œ1xY w)Nr   )Úcffi_usecasesc                  ó   •—  ‰ d«       y rö   r#   )r)   s   €r&   rz   zITestErrorMessages.test_cffi_function_pointer_template_source.<locals>.foo‰  s
   ø€ á��Ir(   r÷   )Únumba.testsrû   ÚinitÚcffi_cosr   r*   r   r+   r-   r.   r,   )r/   Úmodrz   r1   rš   r)   s        @r&   Ú*test_cffi_function_pointer_template_sourcez<TestErrorMessages.test_cffi_function_pointer_template_sourceƒ  sv   ø€ å4Ø�‰Œ
Ø�|‰|ˆä	ó	ó 
ð	ð ×Ñœv×1Ñ1Ô2°fÙŒE÷ 3ô �V×%Ñ%Ó&ˆØ�‰ÐFÈÕO÷	 3Ð2ús   ÁB	Â	Bc                 óŠ  — t         j                   G d„ dt        j                  «      «       } G d„ dt         j                  «      }t        j
                  ||ddg«       | j                  t        j                  «      5 } |dd¬	«       d d d «       t        j                  «      }| j                  d
|«       y # 1 sw Y   Œ1xY w)Nc                   ó   — e Zd Zy)ú;TestErrorMessages.test_missing_source.<locals>.ParticleTypeN)r4   r5   r6   r#   r(   r&   ÚParticleTyper  •  s   „ àr(   r  c                   ó   — e Zd Zd„ Zy)ú7TestErrorMessages.test_missing_source.<locals>.Particlec                 óB   — t         j                  j                  | |«      S r"   )r   ÚStructRefProxyÚ__new__)ÚclsÚposÚmasss      r&   r
  z?TestErrorMessages.test_missing_source.<locals>.Particle.__new__š  s   € Ü ×/Ñ/×7Ñ7¸¸SÓAÐAr(   N)r4   r5   r6   r
  r#   r(   r&   ÚParticler  ™  s   „ óBr(   r  r  r  r    r;   )r  r  z#missing a required argument: 'mass')r   Úregisterr   Ú	StructRefr	  Údefine_proxyr*   r   r+   r-   r.   r,   )r/   r  r  r1   rš   s        r&   Útest_missing_sourcez%TestErrorMessages.test_missing_source“  s    € ä	×	Ñ	ô	œ5Ÿ?™?ó 	ó 
ð	ô	B”y×/Ñ/ô 	Bô
 	×Ñ˜x¨¸¸v°ÔGà×Ñœv×1Ñ1Ô2°fÙ˜ Õ#÷ 3ô �V×%Ñ%Ó&ˆØ�‰Ð;¸VÕD÷	 3Ð2ús   Á>B9Â9CN)r4   r5   r6   r›   r    r   r­   r³   r¸   r¼   rÇ   rß   rì   rñ   rù   r   r  r  r#   r(   r&   rŠ   rŠ   ²   sh   „ ò,ò,*ð& ñ>ó ð>ò$+ò 
<òò+ò47òBNò"Nò"Pð ñPó ðPóEr(   rŠ   c                   ó   — e Zd Zd„ Zy)Ú"TestDeveloperSpecificErrorMessagesc                 ó$  — d„ }t        dd«      5  | j                  t        j                  «      5 } t	        d«      |«       d d d «       d d d «       t        j                  «      }| j                  d|«       y # 1 sw Y   Œ9xY w# 1 sw Y   Œ=xY w)Nc                 ó&   — | j                  d«       y )Néÿÿÿÿ)ÚmaxrH   s    r&   rz   zPTestDeveloperSpecificErrorMessages.test_bound_function_error_string.<locals>.foo«  s   € Ø�E‰E�"�Ir(   ÚDEVELOPER_MODEr    zvoid(int64[:,:])ztoo many positional arguments)r   r*   r   r+   r   r-   r.   r,   r²   s       r&   Ú test_bound_function_error_stringzCTestDeveloperSpecificErrorMessages.test_bound_function_error_string©  sw   € ò	ô Ð-¨qÕ1Ø×"Ñ"¤6×#5Ñ#5Ô6¸&Ø(”Ð'Ó(¨Ô-÷ 7÷ 2ô �V×%Ñ%Ó&ˆØ�‰Ð5°vÕ>÷	 7Ð6ú÷ 2Ð1ús"   � B°A:ÁBÁ:B	Á?BÂBN)r4   r5   r6   r  r#   r(   r&   r  r  §  s   „ ó
?r(   r  c                   ó   — e Zd ZdZd„ Zy)ÚTestCapturedErrorHandlingz-Checks that the way errors are captured.
    c                 ó�  ‡— d„ Št        ‰«      d„ «       }t        j                  «       5  t        j                  dt        j
                  «       | j                  t        «      5 }t        d«      ˆfd„«       }d d d «       d}| j                  |t        j                  «      «       d d d «       y # 1 sw Y   Œ9xY w# 1 sw Y   y xY w)Nc                  ó   — y r"   r#   rH   s    r&   r¿   z=TestCapturedErrorHandling.test_error_in_overload.<locals>.bar¼  rŽ   r(   c                 ó$   — | j                    d„ }|S )Nc                  ó   — y r"   r#   rH   s    r&   ÚimplzNTestCapturedErrorHandling.test_error_in_overload.<locals>.ol_bar.<locals>.implÃ  rÐ   r(   )Úsome_invalid_attr)r$   r!  s     r&   rÁ   z@TestCapturedErrorHandling.test_error_in_overload.<locals>.ol_bar¿  s   € à×ÒòàˆKr(   Úignorezvoid(int64)c                 ó   •—  ‰| «       y r"   r#   )r$   r¿   s    €r&   rz   z=TestCapturedErrorHandling.test_error_in_overload.<locals>.fooÍ  s
   ø€ á˜•Fr(   z+object has no attribute 'some_invalid_attr')r   ÚwarningsÚcatch_warningsÚsimplefilterr   ÚNumbaPendingDeprecationWarningr*   ÚAttributeErrorr   r,   r-   r.   )r/   rÁ   r1   rz   r2   r¿   s        @r&   Útest_error_in_overloadz0TestCapturedErrorHandling.test_error_in_overloadº  s±   ø€ ò	ô 
�#‹ñ	ó 
ð	ô ×$Ñ$Õ&ä×!Ñ! (Ü"(×"GÑ"GôIð ×"Ñ"¤>Ô2°fÜ�mÓ$óó %ð÷ 3ð EˆHØ�M‰M˜(¤C¨×(8Ñ(8Ó$9Ô:÷ 'Ð&÷
 3Ð2ú÷ 'Ð&ús#   ª:B<Á$B0Á8/B<Â0B9	Â5B<Â<CN)r4   r5   r6   Ú__doc__r*  r#   r(   r&   r  r  ¶  s   „ ñó;r(   r  c                   ó   — e Zd ZdZd„ Zd„ Zy)ÚTestCurlyBracesInPathszU
    Test that error messages handle file paths with curly braces (issue #10094)
    c                 ój   — d}d}t        j                  ||fi «      }d|› �}| j                  ||«       y )Nz5C:\\Users\\{fa977bf3384160bce9243175b380be8}\\file.pyzError at {0}z	Error at ©r   Ú_format_msgÚassertEqual)r/   Úproblematic_pathÚfmtÚresultr2   s        r&   Ú&test_placeholders_with_positional_argsz=TestCurlyBracesInPaths.test_placeholders_with_positional_argsÙ  sI   € ðð 	ð
 ˆä×#Ñ# CÐ*:Ð)<¸bÓAˆàÐ/Ð0Ð1ˆØ×Ñ˜ Õ*r(   c                 ón   — d}d|› �}t        j                  |di «      }d|› �}| j                  ||«       y )Nz{abc123}zPass r#   r/  )r/   Úname_with_bracesr3  r4  r2   s        r&   Ú test_preformatted_string_no_argsz7TestCurlyBracesInPaths.test_preformatted_string_no_argsè  sJ   € ð &ÐØÐ&Ð'Ð(ˆä×#Ñ# C¨¨RÓ0ˆàÐ+Ð,Ð-ˆØ×Ñ˜ Õ*r(   N)r4   r5   r6   r+  r5  r8  r#   r(   r&   r-  r-  Ô  s   „ ñò+ó	+r(   r-  Ú__main__)3r+  Únumpyr=   r¨   r%  r¦   r   r   r   Ú
numba.corer   Únumba.experimentalr   Únumba.extendingr   r	   r
   r   Únumba.core.compilerr   Únumba.core.untyped_passesr   r   r   Únumba.core.typed_passesr   r   r   r   Únumba.core.compiler_machineryr   Únumba.core.types.functionsr   r˜   Únumba.tests.supportr   r   r   r   r   r   Úunittestr   r8   rC   rŠ   r  r  r-  r4   Úmainr#   r(   r&   Ú<module>rF     sø   ðñó Û 	Û ç "Ñ "Ý Ý (÷1ó 1å ,÷6ñ 6÷Fó Få 5Ý D÷>÷ >ó ô; h×&7Ñ&7ô ;ô&7˜x×0Ñ0ô 7ôq7˜H×-Ñ-ô q7ôhrE˜×)Ñ)ô rEôj?¨°h×6GÑ6Gô ?ô; ¨Xô ;ô<+˜X×.Ñ.ô +ð@ ˆzÒØ€H‡M�M…Oð r(   