Commit 035690ca authored by Stefan Behnel's avatar Stefan Behnel

Revert "Allow any type in dataclasses.InitVar() again."

This reverts commit cd5fb480.
parent e0436129
...@@ -1223,9 +1223,7 @@ class TemplatedTypeNode(CBaseTypeNode): ...@@ -1223,9 +1223,7 @@ class TemplatedTypeNode(CBaseTypeNode):
error(template_node.pos, "unknown type in template argument") error(template_node.pos, "unknown type in template argument")
type = error_type type = error_type
elif type and base_type.python_type_constructor_name and not (type.is_pyobject or type.is_memoryviewslice): elif type and base_type.python_type_constructor_name and not (type.is_pyobject or type.is_memoryviewslice):
if base_type.python_type_constructor_name not in ('dataclasses.InitVar',): if type.is_numeric and template_node.is_name and template_node.name in ('int', 'long', 'float', 'complex'):
pass # Allow any type (Python or C) for these.
elif type.is_numeric and template_node.is_name and template_node.name in ('int', 'long', 'float', 'complex'):
# int, long, float, complex => make sure we use the Python types # int, long, float, complex => make sure we use the Python types
type = env.builtin_scope().lookup_here(template_node.name).type type = env.builtin_scope().lookup_here(template_node.name).type
else: else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment