mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-12 11:09:14 +02:00
* 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:
parent
224aae8993
commit
d7cff1cd31
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user