mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-16 01:43:35 +00:00
compiler/add_foreign_enum.m:
compiler/check_type_inst_mode_defns.m:
There used to be unnecessary differences between how we reported
foreign_enum and foreign_export_enum pragmas for non-enum du types.
Fir this by using the same code for reporting this problem for
both pragmas. Make this code use the best parts of each original approach.
tests/invalid/ee_invalid.err_exp:
tests/invalid/exported_foreign_enum.err_exp:
Expect the updated text.
5.8 KiB
5.8 KiB
exported_foreign_enum.m:073: Error: the Mercury definition of
exported_foreign_enum.m:073: `exported_foreign_enum.foo'/0 is not an
exported_foreign_enum.m:073: enumeration type, so there must not be any
exported_foreign_enum.m:073: `:- pragma foreign_export_enum' declarations for
exported_foreign_enum.m:073: it.
exported_foreign_enum.m:068: That Mercury definition is here.
exported_foreign_enum.m:068: It has this non-zero arity constructor:
exported_foreign_enum.m:068: `foo'/1.
exported_foreign_enum.m:074: Error: the Mercury definition of
exported_foreign_enum.m:074: `exported_foreign_enum.foo'/0 is not an
exported_foreign_enum.m:074: enumeration type, so there must not be any
exported_foreign_enum.m:074: `:- pragma foreign_export_enum' declarations for
exported_foreign_enum.m:074: it.
exported_foreign_enum.m:068: That Mercury definition is here.
exported_foreign_enum.m:068: It has this non-zero arity constructor:
exported_foreign_enum.m:068: `foo'/1.
exported_foreign_enum.m:075: Error: the Mercury definition of
exported_foreign_enum.m:075: `exported_foreign_enum.foo'/0 is not an
exported_foreign_enum.m:075: enumeration type, so there must not be any
exported_foreign_enum.m:075: `:- pragma foreign_export_enum' declarations for
exported_foreign_enum.m:075: it.
exported_foreign_enum.m:068: That Mercury definition is here.
exported_foreign_enum.m:068: It has this non-zero arity constructor:
exported_foreign_enum.m:068: `foo'/1.
exported_foreign_enum.m:077: Error: the Mercury definition of
exported_foreign_enum.m:077: `exported_foreign_enum.foo'/0 is not an
exported_foreign_enum.m:077: enumeration type, so there must not be any
exported_foreign_enum.m:077: `:- pragma foreign_enum' declarations for it.
exported_foreign_enum.m:068: That Mercury definition is here.
exported_foreign_enum.m:068: It has this non-zero arity constructor:
exported_foreign_enum.m:068: `foo'/1.
exported_foreign_enum.m:082: Error: the Mercury definition of
exported_foreign_enum.m:082: `exported_foreign_enum.foo'/0 is not an
exported_foreign_enum.m:082: enumeration type, so there must not be any
exported_foreign_enum.m:082: `:- pragma foreign_enum' declarations for it.
exported_foreign_enum.m:068: That Mercury definition is here.
exported_foreign_enum.m:068: It has this non-zero arity constructor:
exported_foreign_enum.m:068: `foo'/1.
exported_foreign_enum.m:087: Error: the Mercury definition of
exported_foreign_enum.m:087: `exported_foreign_enum.foo'/0 is not an
exported_foreign_enum.m:087: enumeration type, so there must not be any
exported_foreign_enum.m:087: `:- pragma foreign_enum' declarations for it.
exported_foreign_enum.m:068: That Mercury definition is here.
exported_foreign_enum.m:068: It has this non-zero arity constructor:
exported_foreign_enum.m:068: `foo'/1.
exported_foreign_enum.m:095: Error: the Mercury definition of
exported_foreign_enum.m:095: `exported_foreign_enum.t1'/0 is not an
exported_foreign_enum.m:095: enumeration type, so there must not be any
exported_foreign_enum.m:095: `:- pragma foreign_enum' declarations for it.
exported_foreign_enum.m:012: That Mercury definition is here.
exported_foreign_enum.m:012: It has this non-zero arity constructor:
exported_foreign_enum.m:012: `f13'/1.
exported_foreign_enum.m:100: Error: the Mercury definition of
exported_foreign_enum.m:100: `exported_foreign_enum.t1'/0 is not an
exported_foreign_enum.m:100: enumeration type, so there must not be any
exported_foreign_enum.m:100: `:- pragma foreign_enum' declarations for it.
exported_foreign_enum.m:012: That Mercury definition is here.
exported_foreign_enum.m:012: It has this non-zero arity constructor:
exported_foreign_enum.m:012: `f13'/1.
exported_foreign_enum.m:105: Error: the Mercury definition of
exported_foreign_enum.m:105: `exported_foreign_enum.t1'/0 is not an
exported_foreign_enum.m:105: enumeration type, so there must not be any
exported_foreign_enum.m:105: `:- pragma foreign_enum' declarations for it.
exported_foreign_enum.m:012: That Mercury definition is here.
exported_foreign_enum.m:012: It has this non-zero arity constructor:
exported_foreign_enum.m:012: `f13'/1.
exported_foreign_enum.m:133: Error: this `:- pragma foreign_enum' declaration
exported_foreign_enum.m:133: for `t3'/0 is incompatible with the equivalence
exported_foreign_enum.m:133: type definition in the implementation section.
exported_foreign_enum.m:131: That definition is here.
exported_foreign_enum.m:138: Error: this `:- pragma foreign_enum' declaration
exported_foreign_enum.m:138: for `t3'/0 is incompatible with the equivalence
exported_foreign_enum.m:138: type definition in the implementation section.
exported_foreign_enum.m:131: That definition is here.
exported_foreign_enum.m:143: Error: this `:- pragma foreign_enum' declaration
exported_foreign_enum.m:143: for `t3'/0 is incompatible with the equivalence
exported_foreign_enum.m:143: type definition in the implementation section.
exported_foreign_enum.m:131: That definition is here.
exported_foreign_enum.m:073: `exported_foreign_enum.foo'/0 is not an
exported_foreign_enum.m:073: enumeration type, so there must not be any
exported_foreign_enum.m:073: `:- pragma foreign_export_enum' declarations for
exported_foreign_enum.m:073: it.
exported_foreign_enum.m:068: That Mercury definition is here.
exported_foreign_enum.m:068: It has this non-zero arity constructor:
exported_foreign_enum.m:068: `foo'/1.
exported_foreign_enum.m:074: Error: the Mercury definition of
exported_foreign_enum.m:074: `exported_foreign_enum.foo'/0 is not an
exported_foreign_enum.m:074: enumeration type, so there must not be any
exported_foreign_enum.m:074: `:- pragma foreign_export_enum' declarations for
exported_foreign_enum.m:074: it.
exported_foreign_enum.m:068: That Mercury definition is here.
exported_foreign_enum.m:068: It has this non-zero arity constructor:
exported_foreign_enum.m:068: `foo'/1.
exported_foreign_enum.m:075: Error: the Mercury definition of
exported_foreign_enum.m:075: `exported_foreign_enum.foo'/0 is not an
exported_foreign_enum.m:075: enumeration type, so there must not be any
exported_foreign_enum.m:075: `:- pragma foreign_export_enum' declarations for
exported_foreign_enum.m:075: it.
exported_foreign_enum.m:068: That Mercury definition is here.
exported_foreign_enum.m:068: It has this non-zero arity constructor:
exported_foreign_enum.m:068: `foo'/1.
exported_foreign_enum.m:077: Error: the Mercury definition of
exported_foreign_enum.m:077: `exported_foreign_enum.foo'/0 is not an
exported_foreign_enum.m:077: enumeration type, so there must not be any
exported_foreign_enum.m:077: `:- pragma foreign_enum' declarations for it.
exported_foreign_enum.m:068: That Mercury definition is here.
exported_foreign_enum.m:068: It has this non-zero arity constructor:
exported_foreign_enum.m:068: `foo'/1.
exported_foreign_enum.m:082: Error: the Mercury definition of
exported_foreign_enum.m:082: `exported_foreign_enum.foo'/0 is not an
exported_foreign_enum.m:082: enumeration type, so there must not be any
exported_foreign_enum.m:082: `:- pragma foreign_enum' declarations for it.
exported_foreign_enum.m:068: That Mercury definition is here.
exported_foreign_enum.m:068: It has this non-zero arity constructor:
exported_foreign_enum.m:068: `foo'/1.
exported_foreign_enum.m:087: Error: the Mercury definition of
exported_foreign_enum.m:087: `exported_foreign_enum.foo'/0 is not an
exported_foreign_enum.m:087: enumeration type, so there must not be any
exported_foreign_enum.m:087: `:- pragma foreign_enum' declarations for it.
exported_foreign_enum.m:068: That Mercury definition is here.
exported_foreign_enum.m:068: It has this non-zero arity constructor:
exported_foreign_enum.m:068: `foo'/1.
exported_foreign_enum.m:095: Error: the Mercury definition of
exported_foreign_enum.m:095: `exported_foreign_enum.t1'/0 is not an
exported_foreign_enum.m:095: enumeration type, so there must not be any
exported_foreign_enum.m:095: `:- pragma foreign_enum' declarations for it.
exported_foreign_enum.m:012: That Mercury definition is here.
exported_foreign_enum.m:012: It has this non-zero arity constructor:
exported_foreign_enum.m:012: `f13'/1.
exported_foreign_enum.m:100: Error: the Mercury definition of
exported_foreign_enum.m:100: `exported_foreign_enum.t1'/0 is not an
exported_foreign_enum.m:100: enumeration type, so there must not be any
exported_foreign_enum.m:100: `:- pragma foreign_enum' declarations for it.
exported_foreign_enum.m:012: That Mercury definition is here.
exported_foreign_enum.m:012: It has this non-zero arity constructor:
exported_foreign_enum.m:012: `f13'/1.
exported_foreign_enum.m:105: Error: the Mercury definition of
exported_foreign_enum.m:105: `exported_foreign_enum.t1'/0 is not an
exported_foreign_enum.m:105: enumeration type, so there must not be any
exported_foreign_enum.m:105: `:- pragma foreign_enum' declarations for it.
exported_foreign_enum.m:012: That Mercury definition is here.
exported_foreign_enum.m:012: It has this non-zero arity constructor:
exported_foreign_enum.m:012: `f13'/1.
exported_foreign_enum.m:133: Error: this `:- pragma foreign_enum' declaration
exported_foreign_enum.m:133: for `t3'/0 is incompatible with the equivalence
exported_foreign_enum.m:133: type definition in the implementation section.
exported_foreign_enum.m:131: That definition is here.
exported_foreign_enum.m:138: Error: this `:- pragma foreign_enum' declaration
exported_foreign_enum.m:138: for `t3'/0 is incompatible with the equivalence
exported_foreign_enum.m:138: type definition in the implementation section.
exported_foreign_enum.m:131: That definition is here.
exported_foreign_enum.m:143: Error: this `:- pragma foreign_enum' declaration
exported_foreign_enum.m:143: for `t3'/0 is incompatible with the equivalence
exported_foreign_enum.m:143: type definition in the implementation section.
exported_foreign_enum.m:131: That definition is here.