Skip to content

Commit 2c49751

Browse files
committed
Do not cast Nothing type in Java translator
1 parent fd10bd1 commit 2c49751

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/translators/java.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,11 @@ def visit_call_argument(self, node):
408408
def visit_bottom_constant(self, node):
409409
return self.get_ident() + "{}{}null{}{}".format(
410410
'(' if self._parent_is_func_ref() else '',
411-
'(' + self.get_type_name(node.t) + ') ' if node.t else '',
411+
(
412+
'(' + self.get_type_name(node.t) + ') '
413+
if node.t and node.t != tp.Nothing
414+
else ''
415+
),
412416
')' if self._parent_is_func_ref() else '',
413417
';' if self._parent_is_block() else ''
414418
)

0 commit comments

Comments
 (0)