We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 41261b9 commit c541647Copy full SHA for c541647
py/dml/c_backend.py
@@ -811,13 +811,13 @@ def generate_implement_method(device, ifacestruct, meth, indices):
811
# method in DML
812
raise EMETH(meth.site, None, 'interface method is variadic')
813
for ((mp, mt), it) in zip(meth.inp, iface_input_types):
814
- if safe_realtype(mt).cmp(safe_realtype(it)) != 0:
+ if safe_realtype_unconst(mt).cmp(safe_realtype_unconst(it)) != 0:
815
raise EARGT(meth.site, 'implement', meth.name,
816
mt, mp, it, 'method')
817
if iface_num_outputs and dml.globals.dml_version != (1, 2):
818
[(_, mt)] = meth.outp
819
- if safe_realtype(mt).cmp(
820
- safe_realtype(ifacemethtype.output_type)) != 0:
+ if safe_realtype_unconst(mt).cmp(
+ safe_realtype_unconst(ifacemethtype.output_type)) != 0:
821
822
mt, '<return value>', ifacemethtype.output_type,
823
'method')
py/dml/ctree.py
@@ -3160,8 +3160,8 @@ def mkInterfaceMethodRef(site, iface_node, indices, method_name):
3160
3161
if (not isinstance(ftype, TFunction)
3162
or not ftype.input_types
3163
- or TPtr(safe_realtype(TNamed('conf_object_t'))).cmp(
3164
- safe_realtype(ftype.input_types[0])) != 0):
+ or TPtr(safe_realtype_unconst(TNamed('conf_object_t'))).cmp(
+ safe_realtype_unconst(ftype.input_types[0])) != 0):
3165
# non-method members are not accessible
3166
raise EMEMBER(site, struct_name, method_name)
3167
py/dml/structure.py
@@ -674,7 +674,8 @@ def typecheck_method_override(m1, m2):
674
# TODO move to caller
675
(_, type1) = eval_type(t1, a1.site, None, global_scope)
676
(_, type2) = eval_type(t2, a2.site, None, global_scope)
677
- if safe_realtype(type1).cmp(safe_realtype(type2)) != 0:
+ if safe_realtype_unconst(type1).cmp(
678
+ safe_realtype_unconst(type2)) != 0:
679
raise EMETH(a1.site, a2.site,
680
f"mismatching types in input argument {n1}")
681
@@ -683,7 +684,8 @@ def typecheck_method_override(m1, m2):
683
684
((n1, t1), (n2, t2)) = (a1.args, a2.args)
685
686
687
688
689
msg = "mismatching types in return value"
690
if len(outp1) > 1:
691
msg += f" {i + 1}"
py/dml/traits.py
@@ -394,11 +394,11 @@ def typecheck_method_override(left, right):
394
if throws0 != throws1:
395
raise EMETH(site0, site1, "different nothrow annotations")
396
for ((n, t0), (_, t1)) in zip(inp0, inp1):
397
- if realtype(t0).cmp(realtype(t1)) != 0:
+ if safe_realtype_unconst(t0).cmp(safe_realtype_unconst(t1)) != 0:
398
raise EMETH(site0, site1,
399
"mismatching types in input argument %s" % (n,))
400
for (i, ((_, t0), (_, t1))) in enumerate(zip(outp0, outp1)):
401
402
403
"mismatching types in output argument %d" % (i + 1,))
404
py/dml/types.py
@@ -886,14 +886,14 @@ def cmp_fuzzy(self, other, consider_quals=False):
886
cconst = conv_const if consider_quals else lambda c, t: t
887
if not dml.globals.compat_dml12:
888
if isinstance(other, (TArray, TPtr)):
889
- return cconst(self.const, self.base).cmp(
+ return cconst(self.const, self.base).cmp_fuzzy(
890
cconst(other.const and isinstance(other, TArray),
891
other.base),
892
consider_quals)
893
elif isinstance(other, (TPtr, TArray)):
894
if self.base.void or other.base.void:
895
return 0
896
- if (cconst(self.const, self.base).cmp(
+ if (cconst(self.const, self.base).cmp_fuzzy(
897
898
other.base), consider_quals) == 0):
899
0 commit comments