View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
---|---|---|---|---|---|---|---|---|---|
0000129 | mercury | Bug | public | 2010-01-18 11:50 | 2010-01-25 16:29 | ||||
Reporter | wangp | ||||||||
Assigned To | wangp | ||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||
Status | resolved | Resolution | fixed | ||||||
Product Version | |||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0000129: java grade generates uncompilable code for some uses of typeclasses | ||||||||
Description | From Max: "For your information, I have a bug in the Java BE of Mercury. It all compiles at the Mercury level (it even works in the asm grade), but the java compilers complains of: Making Java class files Mercury/java/x86_64-unknown-linux-gnu/Mercury/javas/jmercury/sewol.java:5471: inconvertible types found : jmercury.runtime.TypeCtorInfo_Struct required: java.lang.Object[] TypeClassInfo_for_workflow_case_238 = (/* typeclass_info */ java.lang.Object[]) unit.unit__type_ctor_info_unit_0; ^ " | ||||||||
Additional Information | I haven't been able to pull a small test case from our tangled web of proprietary code yet. | ||||||||
Tags | No tags attached. | ||||||||
Attached Files |
|
Notes | |
wangp (developer) 2010-01-22 12:53 |
I think I know where the bug is. `interpret_typeclass_info_manipulator' in higher_order.m tries to evaluate `private_builtin.superclass_from_typeclass_info' at compile time, but the Index calculation is wrong. `private_builtin.superclass_from_typeclass_info' calls `MR_typeclass_info_superclass_info', defined in mercury_type_info.h: #define MR_typeclass_info_superclass_info(tci, n) \ (((MR_Word *)(tci))[MR_typeclass_info_num_extra_instance_args(tci) + (n)]) where: "MR_typeclass_info_num_extra_instance_args gives the sum of MR_typeclass_info_num_instance_type_vars and MR_typeclass_info_num_instance_constraints". But `interpret_typeclass_info_manipulator' only adds NumConstraints. I'm not sure how to get MR_typeclass_info_num_instance_type_vars at compile time. Somewhere in hlds_instance_defn? The bug also affects type_info_from_typeclass_info. |
Issue History | |||
Date Modified | Username | Field | Change |
---|---|---|---|
2010-01-18 11:50 | wangp | New Issue | |
2010-01-18 11:51 | wangp | Status | new => assigned |
2010-01-18 11:51 | wangp | Assigned To | => wangp |
2010-01-22 12:53 | wangp | Note Added: 0000247 | |
2010-01-25 16:29 | wangp | Status | assigned => resolved |
2010-01-25 16:29 | wangp | Resolution | open => fixed |