* handle constsyms without an associated type by generating a default type

git-svn-id: branches/jvmbackend@18485 -
This commit is contained in:
Jonas Maebe 2011-08-20 08:03:47 +00:00
parent 41624e8102
commit ee9cfc8916

View File

@ -380,7 +380,30 @@ implementation
constsym:
begin
csym:=tconstsym(sym);
result:=jvmencodetype(csym.constdef);
{ some constants can be untyped }
if assigned (csym.constdef) then
result:=jvmencodetype(csym.constdef)
else
begin
case csym.consttyp of
constord:
result:=jvmencodetype(s32inttype);
constreal:
result:=jvmencodetype(s64floattype);
constset:
internalerror(2011040701);
constpointer,
constnil:
result:=jvmencodetype(java_jlobject);
constwstring,
conststring:
result:=jvmencodetype(java_jlstring);
constguid:
internalerror(2011040702);
else
internalerror(2011040703);
end;
end;
result:=usesymname+' '+result;
end;
else