Prechádzať zdrojové kódy

Merged revisions 497-498 via svnmerge from
/trunk

git-svn-id: branches/fixes_2_0@518 -

peter 20 rokov pred
rodič
commit
31549530e2
3 zmenil súbory, kde vykonal 14 pridanie a 1 odobranie
  1. 1 0
      .gitattributes
  2. 1 1
      compiler/nmem.pas
  3. 12 0
      tests/webtbs/tw4115.pp

+ 1 - 0
.gitattributes

@@ -5936,6 +5936,7 @@ tests/webtbs/tw4055.pp svneol=native#text/plain
 tests/webtbs/tw4058.pp svneol=native#text/plain
 tests/webtbs/tw4078.pp svneol=native#text/plain
 tests/webtbs/tw4089.pp svneol=native#text/plain
+tests/webtbs/tw4115.pp svneol=native#text/plain
 tests/webtbs/ub1873.pp svneol=native#text/plain
 tests/webtbs/ub1883.pp svneol=native#text/plain
 tests/webtbs/uw0555.pp svneol=native#text/plain

+ 1 - 1
compiler/nmem.pas

@@ -652,7 +652,7 @@ implementation
          { maybe type conversion for the index value, but
            do not convert enums,booleans,char }
          if (right.resulttype.def.deftype<>enumdef) and
-            not(is_char(right.resulttype.def)) and
+            not(is_char(right.resulttype.def) or is_widechar(right.resulttype.def)) and
             not(is_boolean(right.resulttype.def)) then
            begin
              inserttypeconv(right,sinttype);

+ 12 - 0
tests/webtbs/tw4115.pp

@@ -0,0 +1,12 @@
+{ Source provided for Free Pascal Bug Report 4115 }
+{ Submitted by "Alexey Chernobayev" on  2005-06-25 }
+{ e-mail: [email protected] }
+var
+  A: array [WideChar] of Char;
+  W: WideChar;
+begin
+  A['a'] := 'b'; // Ok
+  W := 'c';
+
+  A[W] := 'd';
+end.