tb0053.pp 700 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. { %FAIL }
  2. { Old file: tbf0272.pp }
  3. { No error issued if wrong parameter in function inside a second function OK 0.99.13 (PFV) }
  4. program test_const_string;
  5. const
  6. conststring = 'Constant string';
  7. function astring(s :string) : string;
  8. begin
  9. astring:='Test string'+s;
  10. end;
  11. procedure testvar(var s : string);
  12. begin
  13. writeln('testvar s is "',s,'"');
  14. end;
  15. procedure testconst(const s : string);
  16. begin
  17. writeln('testconst s is "',s,'"');
  18. end;
  19. procedure testvalue(s : string);
  20. begin
  21. writeln('testvalue s is "',s,'"');
  22. end;
  23. const
  24. s : string = 'test';
  25. begin
  26. testvalue(astring('e'));
  27. testconst(astring(s));
  28. testconst(conststring);
  29. testvar(conststring);{ refused a compile time }
  30. end.