foo.adb 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. -- Copyright 2015-2022 Free Software Foundation, Inc.
  2. --
  3. -- This program is free software; you can redistribute it and/or modify
  4. -- it under the terms of the GNU General Public License as published by
  5. -- the Free Software Foundation; either version 3 of the License, or
  6. -- (at your option) any later version.
  7. --
  8. -- This program is distributed in the hope that it will be useful,
  9. -- but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. -- GNU General Public License for more details.
  12. --
  13. -- You should have received a copy of the GNU General Public License
  14. -- along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. procedure Foo is
  16. type New_Integer is new Integer;
  17. type Integer_Access is access Integer;
  18. function F (I : Integer; A : Integer_Access) return Boolean is
  19. begin
  20. return True;
  21. end F;
  22. function F (I : New_Integer; A : Integer_Access) return Boolean is
  23. begin
  24. return False;
  25. end F;
  26. procedure P (I : Integer; A : Integer_Access) is
  27. begin
  28. null;
  29. end P;
  30. procedure P (I : New_Integer; A : Integer_Access) is
  31. begin
  32. null;
  33. end P;
  34. B1 : constant Boolean := F (Integer'(1), null); -- BREAK
  35. B2 : constant Boolean := F (New_Integer'(2), null);
  36. begin
  37. P (Integer'(3), null);
  38. P (New_Integer'(4), null);
  39. end Foo;