Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #654 (closed defect: fixed)

Opened 17 years ago

Last modified 16 years ago

bugs in tango.core.Variant

Reported by: delta Assigned to: DRK
Priority: major Milestone: 0.99.2 RC5
Component: Core Functionality Version: trunk
Keywords: Cc:

Description

I was using Variant for a project and found that there are some problems - it doesn't compile for some instantiations because of them:

line 315:
this.value.ptr = cast(void*)T;
should be:
this.value.ptr = cast(void*)value;

line 319:
this.value.obj = T;
should be:
this.value.obj = value;

Also I'd suggest to remove line 438, as the compiler complains about unreachable code when compiling with -debug and -w.

I guess this has gone by unnoticed because the unit tests don't cover instantiations with pointers, class objects or (I think) structs (and because Variant is not used very often I guess).

Change History

10/02/07 16:56:45 changed by kris

  • owner changed from sean to kris.

Hey, thanks for spotting this ... I'll fix it later today

10/02/07 17:22:32 changed by sean

  • status changed from new to closed.
  • resolution set to fixed.

Fixed by changeset [2601].

10/02/07 17:22:51 changed by sean

  • milestone set to 0.99.3 RC6.

10/05/07 09:41:17 changed by larsivi

  • milestone changed from 0.99.3 RC6 to 0.99.2 RC5.

(in reply to: ↑ description ) 12/24/07 17:16:57 changed by delta

  • status changed from closed to reopened.
  • resolution deleted.

Revision 3045 undid the fix of the 2 lines in opAssign - T is again used instead of value. I'd suggest adding unit tests with pointers and objects to make sure this stays fixed.

12/24/07 17:38:18 changed by kris

  • owner changed from kris to DRK.
  • status changed from reopened to new.

02/16/08 06:32:14 changed by DRK

  • status changed from new to closed.
  • resolution set to fixed.

(In [3196]) Fixed Variant, and added some unit tests to make sure there aren't regressions. Closes #654