Use: Movable: use type clause can be moved to body
Ada source code controller
Brought to you by:
jprosen
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
Anonymous
Got this issue with 1.21r3, of course.
Could you please post the complete, compilable example? The only operators I see here are universal.
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
Can you please publish the fix in Git?
Le 22/07/2019 à 10:57, Pascal MALAISE a écrit :
--
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
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]
Le 05/08/2019 à 21:26, Pascal MALAISE a écrit :
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]