* give an error when trying to typecast a unicodestring into a pwidechar

on the JVM target (we can't access the characters of a JLString as an
    array)

git-svn-id: branches/jvmbackend@18769 -
This commit is contained in:
Jonas Maebe 2011-08-20 08:34:21 +00:00
parent 224aae8993
commit d7cff1cd31

View File

@ -457,6 +457,15 @@ implementation
var
ps: tsym;
begin
{ also called for unicodestring->pwidechar, not supported since we can't
directly access the characters in java.lang.String }
if not is_ansistring(left.resultdef) or
not is_pchar(resultdef) then
begin
CGMessage2(type_e_illegal_type_conversion,left.resultdef.typename,resultdef.typename);
result:=nil;
exit;
end;
result:=ctypeconvnode.create_explicit(left,java_ansistring);
ps:=search_struct_member(java_ansistring,'INTERNCHARS');
if not assigned(ps) or