mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 01:19:55 +02:00
compiler: fix nested type typecast (issue #0016222)
git-svn-id: trunk@15122 -
This commit is contained in:
parent
e721a623eb
commit
c62c487b24
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -10346,6 +10346,7 @@ tests/webtbs/tw16163.pp svneol=native#text/plain
|
|||||||
tests/webtbs/tw1617.pp svneol=native#text/plain
|
tests/webtbs/tw1617.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw16188.pp svneol=native#text/plain
|
tests/webtbs/tw16188.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw1622.pp svneol=native#text/plain
|
tests/webtbs/tw1622.pp svneol=native#text/plain
|
||||||
|
tests/webtbs/tw16222.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw1623.pp svneol=native#text/plain
|
tests/webtbs/tw1623.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw1634.pp svneol=native#text/plain
|
tests/webtbs/tw1634.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw1658.pp svneol=native#text/plain
|
tests/webtbs/tw1658.pp svneol=native#text/plain
|
||||||
|
@ -1276,11 +1276,20 @@ implementation
|
|||||||
typesym:
|
typesym:
|
||||||
begin
|
begin
|
||||||
p1.free;
|
p1.free;
|
||||||
|
if try_to_consume(_LKLAMMER) then
|
||||||
|
begin
|
||||||
|
p1:=comp_expr(true);
|
||||||
|
consume(_RKLAMMER);
|
||||||
|
p1:=ctypeconvnode.create_explicit(p1,ttypesym(sym).typedef);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
p1:=ctypenode.create(ttypesym(sym).typedef);
|
p1:=ctypenode.create(ttypesym(sym).typedef);
|
||||||
if (is_class(ttypesym(sym).typedef) or is_objcclass(ttypesym(sym).typedef)) and
|
if (is_class(ttypesym(sym).typedef) or is_objcclass(ttypesym(sym).typedef)) and
|
||||||
not(block_type in [bt_type,bt_const_type,bt_var_type]) then
|
not(block_type in [bt_type,bt_const_type,bt_var_type]) then
|
||||||
p1:=cloadvmtaddrnode.create(p1);
|
p1:=cloadvmtaddrnode.create(p1);
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
constsym:
|
constsym:
|
||||||
begin
|
begin
|
||||||
p1.free;
|
p1.free;
|
||||||
|
22
tests/webtbs/tw16222.pp
Normal file
22
tests/webtbs/tw16222.pp
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
{ %norun }
|
||||||
|
program tw16222;
|
||||||
|
|
||||||
|
{$ifdef fpc}
|
||||||
|
{$mode delphi}
|
||||||
|
{$endif}
|
||||||
|
|
||||||
|
type
|
||||||
|
TOuterClass = class
|
||||||
|
public
|
||||||
|
type
|
||||||
|
TInnerClass = class
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function fn(P: Pointer): TOuterClass.TInnerClass;
|
||||||
|
begin
|
||||||
|
Result := TOuterClass.TInnerClass(P);
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user