comp.lang.ada
 help / color / mirror / Atom feed
* Conformance rules question
@ 1988-04-27 14:08 Burch Seymour
  1988-04-28 12:22 ` Robert Firth
  0 siblings, 1 reply; 2+ messages in thread
From: Burch Seymour @ 1988-04-27 14:08 UTC (permalink / raw)


In the following code package paramtest will compile without error
even though the string initialization values in the spec and body
do not match. Package paramtest2, which uses an integer argument
with different values will fail. What is the rational behind this?

--------------------------------------------------------------
package paramtest is
  procedure string_in ( a_string : in string := "default value");
end paramtest;

package body paramtest is
  procedure string_in ( a_string : in string := "other default value") is
    begin
     null;
  end string_in;
end paramtest;

package paramtest2 is
  procedure integer_in ( an_integer : in integer := 15 );
end paramtest2;

package body paramtest2 is
  procedure integer_in ( an_integer : in integer := 25 ) is
    begin
     null;
  end integer_in;
end paramtest2;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Conformance rules question
  1988-04-27 14:08 Conformance rules question Burch Seymour
@ 1988-04-28 12:22 ` Robert Firth
  0 siblings, 0 replies; 2+ messages in thread
From: Robert Firth @ 1988-04-28 12:22 UTC (permalink / raw)


In article <1103@augusta.UUCP> bs@augusta.UUCP (Burch Seymour) writes:
  In the following code package paramtest will compile without error
  even though the string initialization values in the spec and body
  do not match. Package paramtest2, which uses an integer argument
  with different values will fail. What is the rational behind this?
  
  --------------------------------------------------------------
  package paramtest is
    procedure string_in ( a_string : in string := "default value");
  end paramtest;
  
  package body paramtest is
    procedure string_in ( a_string : in string := "other default value") is
      begin
       null;
    end string_in;
  end paramtest;

There is no rationale; this is a compiler bug.  [RM 6.3.1] gives the
rules that permit the two specifications to differ, and the kind of
difference shown here is not allowed by them.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1988-04-28 12:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1988-04-27 14:08 Conformance rules question Burch Seymour
1988-04-28 12:22 ` Robert Firth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox