title: Why does Str() give "W1057 Implicit string cast from 'ShortString' to 'string'"?
body: <p>Consider:</p>
  
  <pre><code>function x_StrZero(N: Double; W: Integer; D: Integer = 0): String;
  var S : String;
  begin
    Str(N:W:D,S);   
    S := Trim(S);
  </code></pre>
  
  <p>This gives W1057 Implicit string cast from 'ShortString' to 'string'</p>
  
  <p>The <a href="http://docwiki.embarcadero.com/Libraries/en/System.Str" rel="nofollow noreferrer">online doc</a> says:</p>
  
  <pre><code>procedure Str(const X [: Width [:Decimals]]; var S: String);
  </code></pre>
  
  <p>but also</p>
  
  <blockquote>
    <p>Notes: However, on using this procedure, the compiler may issue a warning: W1057 Implicit string cast from '%s' to '%s' (Delphi).</p>
  </blockquote>
  
  <p>Why would this be?</p>
  
  <p>I would like to prevent this ugly workaround:</p>
  
  <pre><code>function x_StrZero(N: Double; W: Integer; D: Integer = 0): String;
  var
    S : String;
    SS : ShortString;
  begin
    Str(N:W:D,SS);
    S := Trim(String(SS));
  </code></pre>
  
  <p>I have read <a href="https://stackoverflow.com/questions/2121265/why-does-delphi-warn-when-assigning-shortstring-to-string">Why does Delphi warn when assigning ShortString to string?</a> but that does not answer this.</p>