Illegal assignment from Integer or Decimal to Currency

Issue #853 resolved
George Mandala created an issue

In IC 2.0, I get "Illegal assignment from Integer to Currency" and "Illegal assignment from Decimal to Currency" errors when I assign a hard coded integer or decimal value to a currency field.

Comments (10)

  1. Scott Wells repo owner

    I'm still working through a few false negatives from IC2's new code inspections. I'll add this to the list for the next build. Thanks for reporting!

  2. Scott Wells repo owner

    Actually, before I do that, have you regenerated your OST? Currency fields should be rendered into the OST as Decimal now. Or in this case are you doing something like:

    Currency currencyValue = 10.0;
    

    Just trying to make sure I look at the right thing when I triage this.

  3. Scott Wells repo owner

    Are the fields in the OST of type Decimal or Currency after OST regeneration? If they're Decimal, you likely saw the "residue" of those inspections while it indexed the new OST, after which they were removed because of the change from Currency to Decimal which allows for assignment.

  4. Scott Wells repo owner

    Gotcha. I'm going to resolve this for now assuming that was the fix, but if you see any other code inspection false negatives, please let me know (ideally along with standalone reproducible examples) and I'll take care of them ASAP.

  5. Mike Jutzin Account Deactivated

    Hi all - ran into the same issue when upgrading from IC to IC2, found this post, and doing a full OST regen fixed it.

    Mike

  6. Log in to comment