Browse Source

* slice() doesn't support packed arrays

git-svn-id: trunk@4454 -
Jonas Maebe 19 years ago
parent
commit
be39a88daa
1 changed files with 3 additions and 1 deletions
  1. 3 1
      compiler/ninl.pas

+ 3 - 1
compiler/ninl.pas

@@ -1851,7 +1851,9 @@ implementation
                   result:=nil;
                   result:=nil;
                   resulttype:=tcallparanode(left).left.resulttype;
                   resulttype:=tcallparanode(left).left.resulttype;
                   if (resulttype.def.deftype <> arraydef) then
                   if (resulttype.def.deftype <> arraydef) then
-                    CGMessagePos(left.fileinfo,type_e_mismatch);
+                    CGMessagePos(left.fileinfo,type_e_mismatch)
+                  else if is_packed_array(resulttype.def) then
+                    CGMessagePos2(left.fileinfo,type_e_got_expected_unpacked_array,'1',resulttype.def.typename);
                   if not(is_integer(tcallparanode(tcallparanode(left).right).left.resulttype.def)) then
                   if not(is_integer(tcallparanode(tcallparanode(left).right).left.resulttype.def)) then
                     CGMessagePos1(tcallparanode(left).right.fileinfo,
                     CGMessagePos1(tcallparanode(left).right.fileinfo,
                       type_e_integer_expr_expected,
                       type_e_integer_expr_expected,