Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions numba/core/types/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,6 @@ def get_call_type(self, context, args, kws):
literal_e = None
nonliteral_e = None
out = None

Comment thread
stuartarchibald marked this conversation as resolved.
Resolved
choice = [True, False] if template.prefer_literal else [False, True]
for uselit in choice:
if uselit:
Expand Down Expand Up @@ -442,7 +441,10 @@ def get_call_type(self, context, args, kws):
raise exc
nonliteral_e = exc
else:
break
# If out returns None don't break as we may need to use
# a literal.
if out is not None:
break
Comment thread
stuartarchibald marked this conversation as resolved.
Resolved

if out is None and (nonliteral_e is not None or literal_e is not None):
header = "- Resolution failure for {} arguments:\n{}\n"
Expand Down
1 change: 1 addition & 0 deletions numba/np/arrayobj.py
Original file line number Diff line number Diff line change
Expand Up @@ -4146,6 +4146,7 @@ def array_ascontiguousarray(context, builder, sig, args):


@lower_builtin("array.astype", types.Array, types.DTypeSpec)
@lower_builtin("array.astype", types.Array, types.StringLiteral)
def array_astype(context, builder, sig, args):
arytype = sig.args[0]
ary = make_array(arytype)(context, builder, value=args[0])
Expand Down
1 change: 1 addition & 0 deletions numba/tests/test_array_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ def check(arr, dtype):
check(arr, np.int32)
check(arr, np.float32)
check(arr, np.complex128)
check(arr, "float32")

# F-contiguous
arr = np.arange(24, dtype=np.int8).reshape((3, 8)).T
Expand Down