diff --git a/compiler/globals.pas b/compiler/globals.pas index bb3697b135..d0f499c3b5 100644 --- a/compiler/globals.pas +++ b/compiler/globals.pas @@ -55,7 +55,8 @@ interface m_pointer_2_procedure,m_autoderef,m_tp_procvar,m_initfinal,m_default_ansistring, m_out,m_default_para,m_duplicate_names,m_hintdirective, m_property,m_default_inline,m_except,m_advanced_records, - m_array_operators,m_prefixed_attributes,m_underscoreisseparator]; + m_array_operators,m_prefixed_attributes,m_underscoreisseparator, + m_function_references,m_anonymous_functions]; delphiunicodemodeswitches = delphimodeswitches + [m_systemcodepage,m_default_unicodestring]; fpcmodeswitches = [m_fpc,m_string_pchar,m_nested_comment,m_repeat_forward, diff --git a/tests/test/tfuncref52.pp b/tests/test/tfuncref52.pp new file mode 100644 index 0000000000..cb840189c8 --- /dev/null +++ b/tests/test/tfuncref52.pp @@ -0,0 +1,29 @@ +// Test to determine that function references are enabled in mode delphi +{$mode delphi} +{ $modeswitch functionreferences} +{%NORUN} +program tfuncref52; + +Type + TProc = Reference to Procedure; + +var + P : TProc; + +Procedure Testit; + + Procedure SoSo; + + begin + + end; + +begin + P:=SoSo; + P; +end; + +begin + Testit; +end. + diff --git a/tests/test/tfuncref53.pp b/tests/test/tfuncref53.pp new file mode 100644 index 0000000000..6cef7a53d4 --- /dev/null +++ b/tests/test/tfuncref53.pp @@ -0,0 +1,25 @@ +// Test to determine that anonymus functions are enabled in mode delphi +{$mode delphi} +{%NORUN} +program tfuncref52; + +Type + TProc = Reference to Procedure; + +var + P : TProc; + +Procedure Testit; + +begin + P:=procedure + begin + + end; + P; +end; + +begin + Testit; +end. +