Browse Source

* Str returns a nicer error (and corrects the position) if a non-ordinal type is passed into it

J. Gareth "Curious Kit" Moreton 3 months ago
parent
commit
95993ea7a4
1 changed files with 2 additions and 1 deletions
  1. 2 1
      compiler/ninl.pas

+ 2 - 1
compiler/ninl.pas

@@ -328,7 +328,8 @@ implementation
            not(is_real or is_enum or
                (source.left.resultdef.typ=orddef)) then
           begin
-            CGMessagePos(fileinfo,parser_e_illegal_expression);
+            CGMessagePos1(source.fileinfo,
+              type_e_integer_expr_expected,source.resultdef.typename);
             exit;
           end;