Menu

#55 Use: Movable: use type clause can be moved to body

Next Release
fixed
None
normal
minor
Always
none
2019-08-05
2019-07-12
Anonymous
No

Given:
with My_Math;
package Lem is

subtype Real is My_Math.Real;
use type My_Math.Real;
Max_Speed : constant := 10_000.0;
type Speed_Range is new Real range -Max_Speed .. +Max_Speed;

We get Adactl message
Error: Use: Movable: "use type" clause for My_Math.Real can be moved to body
But if we remove the "use type My Math.Real" statement we get compiler error
operator for type "Real" defined at my_math.ads:9 is not directly visible
lem.ads:45:38: use clause would make operation legal

Discussion

  • Pascal MALAISE

    Pascal MALAISE - 2019-07-12

    Got this issue with 1.21r3, of course.

     
    • Jean-Pierre Rosen

      Could you please post the complete, compilable example? The only operators I see here are universal.

       
  • Pascal MALAISE

    Pascal MALAISE - 2019-07-13

    Here it is. Just uncomment the line 5 for Adacontrol error message:
    lem.ads:5:12: Error: Use: Unused: "use type" clause for My_Math.Real (possible usage in child units)

    And when commented:
    lem.ads:8:38: operator for type "Real" defined at my_math.ads:3 is not directly visible

    Regards

     
  • Jean-Pierre Rosen

    • status: new --> fixed
    • assigned_to: Jean-Pierre Rosen
     
  • Pascal MALAISE

    Pascal MALAISE - 2019-07-22

    Can you please publish the fix in Git?

     
    • Jean-Pierre Rosen

      Le 22/07/2019 à 10:57, Pascal MALAISE a écrit :

      Can you please publish the fix in Git?

      Done.

      --
      J-P. Rosen
      Adalog
      2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
      Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00
      http://www.adalog.fr

       
      • Pascal MALAISE

        Pascal MALAISE - 2019-08-05

        I am sorry, but looking at the last commit ([bde05b]) I only find an update of test, but not of adacontrol itself.
        Regards

         

        Related

        Commit: [bde05b]

        • Jean-Pierre Rosen

          Le 05/08/2019 à 21:26, Pascal MALAISE a écrit :

          I am sorry, but looking at the last commit ([bde05b]
          https://sourceforge.net/p/adacontrol/code/ci/bde05bccbbb0c542d1e40f0c65013a41d2e26e2c/)
          I only find an update of test, but not of adacontrol itself.
          Ooops, the fix was in the Asiscomps, but I forgot to push it. This is
          done now.

          Thanks for reporting.

          --
          J-P. Rosen
          Adalog
          2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
          Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00
          http://www.adalog.fr

           

          Related

          Commit: [bde05b]

Anonymous
Anonymous

Add attachments
Cancel





Auth0 Logo