From 2be600affffb40770d8eb3e829b060e74e9e9efd Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Thu, 28 Jan 2010 16:14:42 +0000 Subject: [PATCH] * support objc.id. in Delphi mode (mantis #15607) git-svn-id: trunk@14822 - --- .gitattributes | 1 + compiler/pexpr.pas | 5 ++++- tests/webtbs/tw15607.pp | 9 +++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 tests/webtbs/tw15607.pp diff --git a/.gitattributes b/.gitattributes index 81da24f7bb..625aeca6df 100644 --- a/.gitattributes +++ b/.gitattributes @@ -10240,6 +10240,7 @@ tests/webtbs/tw15467.pp svneol=native#text/pascal tests/webtbs/tw15500.pp svneol=native#text/plain tests/webtbs/tw15504.pp svneol=native#text/plain tests/webtbs/tw15530.pp svneol=native#text/pascal +tests/webtbs/tw15607.pp svneol=native#text/plain tests/webtbs/tw1567.pp svneol=native#text/plain tests/webtbs/tw1573.pp svneol=native#text/plain tests/webtbs/tw1592.pp svneol=native#text/plain diff --git a/compiler/pexpr.pas b/compiler/pexpr.pas index 7c091f6d4f..dfd2486757 100644 --- a/compiler/pexpr.pas +++ b/compiler/pexpr.pas @@ -2020,7 +2020,10 @@ implementation begin consume(_POINT); if (p1.resultdef.typ=pointerdef) and - (m_autoderef in current_settings.modeswitches) then + (m_autoderef in current_settings.modeswitches) and + { don't auto-deref objc.id, because then the code + below for supporting id.anyobjcmethod isn't triggered } + (p1.resultdef<>objc_idtype) then begin p1:=cderefnode.create(p1); do_typecheckpass(p1); diff --git a/tests/webtbs/tw15607.pp b/tests/webtbs/tw15607.pp new file mode 100644 index 0000000000..0867171d8f --- /dev/null +++ b/tests/webtbs/tw15607.pp @@ -0,0 +1,9 @@ +{ %norun } + +{$mode delphi}{$modeswitch objectivec1} + +var + o: id; +begin + o.description; +end.