Skip to content

Commit

Permalink
Workaround equivalent to PR 5638.
Browse files Browse the repository at this point in the history
  • Loading branch information
pearu committed Apr 28, 2020
1 parent 6c582b1 commit 23a2734
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 0 additions & 2 deletions numba/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,8 +532,6 @@ def unified_function_type(numba_types, require_precise=True):
if isinstance(t, types.UndefinedFunctionType):
if undefined_function is None:
undefined_function = t
elif 0:
assert undefined_function == t
dispatchers.update(t.dispatchers)
else:
if function is None:
Expand Down
7 changes: 4 additions & 3 deletions numba/tests/test_function_type.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import types as pytypes
from numba import jit, njit, cfunc, types, int64, float64, float32, errors
from numba import literal_unroll
from numba.core.config import IS_32BITS, IS_WIN32
import ctypes
import warnings
Expand Down Expand Up @@ -1074,6 +1075,7 @@ def bar_good(foos):
r'.*first-class function call cannot use keyword arguments')

def test_issue_5615(self):

@njit
def foo1(x):
return x + 1
Expand All @@ -1082,8 +1084,6 @@ def foo1(x):
def foo2(x):
return x + 2

from numba import literal_unroll

@njit
def bar(fcs):
x = 0
Expand All @@ -1096,4 +1096,5 @@ def bar(fcs):
return x

tup = ((foo1, foo2), (foo2, foo1))
print(bar(tup))

self.assertEqual(bar(tup), 39)

0 comments on commit 23a2734

Please sign in to comment.