mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 02:09:33 +02:00
+ correct semantics of private and protected
* small fix in variable scope: a id can be used in a parameter list of a method, even it is used in an anchestor class as field id
This commit is contained in:
parent
f700edae4d
commit
258d6968af
@ -118,8 +118,8 @@ parser_e_destructorname_must_be_done,
|
||||
parser_e_illegal_open_parameter,
|
||||
parser_e_proc_inline_not_supported,
|
||||
parser_w_priv_meth_not_virtual,
|
||||
parser_e_constructor_cannot_be_private,
|
||||
parser_e_destructor_cannot_be_private,
|
||||
parser_w_constructor_should_be_public,
|
||||
parser_w_destructor_should_be_public,
|
||||
parser_n_only_one_destructor,
|
||||
parser_e_no_local_objects,
|
||||
parser_e_no_anonym_objects,
|
||||
@ -155,7 +155,8 @@ parser_w_should_use_override,
|
||||
parser_e_nothing_to_be_overridden,
|
||||
parser_e_no_procedure_to_access_property,
|
||||
parser_e_ill_property_access_sym,
|
||||
parser_e_cant_write_protected_member,
|
||||
parser_e_cant_access_protected_member,
|
||||
parser_e_cant_access_private_member,
|
||||
parser_e_overloaded_are_not_both_virtual,
|
||||
parser_e_overloaded_methodes_not_same_ret,
|
||||
parser_e_dont_nest_export,
|
||||
|
@ -1,4 +1,4 @@
|
||||
const msgtxt : array[1..14076] of char=(
|
||||
const msgtxt : array[1..14106] of char=(
|
||||
'I','_','$','1',' ','k','B',' ','f','r','e','e',#000,'L','_',
|
||||
'$','1',' ','l','i','n','e','s',' ','$','2',' ','k','B',' ',
|
||||
'f','r','e','e',#000,'I','_','$','1',' ','s','t','r','e','a',
|
||||
@ -120,116 +120,118 @@ const msgtxt : array[1..14076] of char=(
|
||||
'N','E',' ','n','o','t',' ','s','u','p','p','o','r','t','e',
|
||||
'd',#000,'W','_','P','r','i','v','a','t','e',' ','m','e','t',
|
||||
'h','o','d','s',' ','s','h','o','u','l','d','n',#039,'t',' ',
|
||||
'b','e',' ','V','I','R','T','U','A','L',#000,'E','_','C','o',
|
||||
'n','s','t','r','u','c','t','o','r',' ','c','a','n',#039,'t',
|
||||
' ','b','e',' ','p','r','i','v','a','t','e',' ','o','r',' ',
|
||||
'p','r','o','t','e','c','t','e','d',#000,'E','_','D','e','s',
|
||||
't','r','u','c','t','o','r',' ','c','a','n',#039,'t',' ','b',
|
||||
'e',' ','p','r','i','v','a','t','e',' ','o','r',' ','p','r',
|
||||
'o','t','e','c','t','e','d',#000,'N','_','C','l','a','s','s',
|
||||
' ','s','h','o','u','l','d',' ','h','a','v','e',' ','o','n',
|
||||
'e',' ','d','e','s','t','r','u','c','t','o','r',' ','o','n',
|
||||
'l','y',#000,'E','_','L','o','c','a','l',' ','c','l','a','s',
|
||||
's',' ','d','e','f','i','n','i','t','i','o','n','s',' ','a',
|
||||
'r','e',' ','n','o','t',' ','a','l','l','o','w','e','d',#000,
|
||||
'E','_','A','n','o','n','y','m',' ','c','l','a','s','s',' ',
|
||||
'd','e','f','i','n','i','t','i','o','n','s',' ','a','r','e',
|
||||
' ','n','o','t',' ','a','l','l','o','w','e','d',#000,'E','_',
|
||||
'O','r','d','i','n','a','l',' ','v','a','l','u','e',' ','e',
|
||||
'x','p','e','c','t','e','d',#000,'E','_','I','l','l','e','g',
|
||||
'a','l',' ','p','a','r','a','m','e','t','e','r',' ','l','i',
|
||||
's','t',#000,'E','_','o','v','e','r','l','o','a','d','e','d',
|
||||
' ','i','d','e','n','t','i','f','i','e','r',' ','i','s','n',
|
||||
#039,'t',' ','a',' ','f','u','n','c','t','i','o','n',' ','i',
|
||||
'd','e','n','t','i','f','i','e','r',#000,'E','_','o','v','e',
|
||||
'r','l','o','a','d','e','d',' ','f','u','n','c','t','i','o',
|
||||
'n','s',' ','h','a','v','e',' ','t','h','e',' ','s','a','m',
|
||||
'e',' ','p','a','r','a','m','e','t','e','r',' ','l','i','s',
|
||||
't',#000,'E','_','f','u','n','c','t','i','o','n',' ','h','e',
|
||||
'a','d','e','r',' ','d','o','e','s','n',#039,'t',' ','m','a',
|
||||
't','c','h',' ','t','h','e',' ','f','o','r','w','a','r','d',
|
||||
' ','d','e','c','l','a','r','a','t','i','o','n',' ','$','1',
|
||||
#000,'N','_','o','n','l','y',' ','v','a','l','u','e','s',' ',
|
||||
'c','a','n',' ','b','e',' ','j','u','m','p','e','d',' ','o',
|
||||
'v','e','r',' ','i','n',' ','e','n','u','m','e','r','a','t',
|
||||
'i','o','n',' ','t','y','p','e','s',#000,'N','_','I','n','t',
|
||||
'e','r','f','a','c','e',' ','a','n','d',' ','i','m','p','l',
|
||||
'e','m','e','n','t','a','t','i','o','n',' ','n','a','m','e',
|
||||
's',' ','a','r','e',' ','d','i','f','f','e','r','e','n','t',
|
||||
' ','!',#000,'E','_','f','u','n','c','t','i','o','n',' ','n',
|
||||
'e','s','t','i','n','g',' ','>',' ','3','1',#000,'E','_','r',
|
||||
'a','n','g','e',' ','c','h','e','c','k',' ','e','r','r','o',
|
||||
'r',' ','w','h','i','l','e',' ','e','v','a','l','u','a','t',
|
||||
'i','n','g',' ','c','o','n','s','t','a','n','t','s',#000,'E',
|
||||
'_','p','o','i','n','t','e','r',' ','t','y','p','e',' ','e',
|
||||
'x','p','e','c','t','e','d',#000,'E','_','c','l','a','s','s',
|
||||
' ','t','y','p','e',' ','e','x','p','e','c','t','e','d',#000,
|
||||
'E','_','d','u','p','l','i','c','a','t','e',' ','c','a','s',
|
||||
'e',' ','l','a','b','e','l',#000,'E','_','t','y','p','e','d',
|
||||
' ','c','o','n','s','t','a','n','t','s',' ','o','f',' ','c',
|
||||
'l','a','s','s','e','s',' ','a','r','e',' ','n','o','t',' ',
|
||||
'a','l','l','o','w','e','d',#000,'E','_','f','u','n','c','t',
|
||||
'i','o','n','s',' ','v','a','r','i','a','b','l','e','s',' ',
|
||||
'o','f',' ','o','v','e','r','l','o','a','d','e','d',' ','f',
|
||||
'u','n','c','t','i','o','n','s',' ','a','r','e',' ','n','o',
|
||||
't',' ','a','l','l','o','w','e','d',#000,'E','_','s','t','r',
|
||||
'i','n','g',' ','l','e','n','g','t','h',' ','m','u','s','t',
|
||||
' ','b','e',' ','a',' ','v','a','l','u','e',' ','f','r','o',
|
||||
'm',' ','1',' ','t','o',' ','2','5','5',#000,'W','_','u','s',
|
||||
'e',' ','e','x','t','e','n','d','e','d',' ','s','y','n','t',
|
||||
'a','x',' ','o','f',' ','D','I','S','P','O','S','E',' ','a',
|
||||
'n','d',' ','N','E','W',' ','t','o',' ','g','e','n','e','r',
|
||||
'a','t','e',' ','i','n','s','t','a','n','c','e','s',' ','o',
|
||||
'f',' ','o','b','j','e','c','t','s',#000,'E','_','c','l','a',
|
||||
's','s',' ','i','d','e','n','t','i','f','i','e','r',' ','e',
|
||||
'x','p','e','c','t','e','d',#000,'E','_','m','e','t','h','o',
|
||||
'd',' ','i','d','e','n','t','i','f','i','e','r',' ','e','x',
|
||||
'p','e','c','t','e','d',#000,'E','_','f','u','n','c','t','i',
|
||||
'o','n',' ','h','e','a','d','e','r',' ','d','o','e','s','n',
|
||||
#039,'t',' ','m','a','t','c','h',' ','a','n','y',' ','m','e',
|
||||
't','h','o','d',' ','o','f',' ','t','h','i','s',' ','c','l',
|
||||
'a','s','s',#000,'P','_','p','r','o','c','e','d','u','r','e',
|
||||
'/','f','u','n','c','t','i','o','n',' ','$','1',' ','(','$',
|
||||
'2',')',' ','a','t',' ','l','i','n','e',' ','$','3',#000,'E',
|
||||
'_','I','l','l','e','g','a','l',' ','f','l','o','a','t','i',
|
||||
'n','g',' ','p','o','i','n','t',' ','c','o','n','s','t','a',
|
||||
'n','t',#000,'E','_','F','A','I','L',' ','c','a','n',' ','b',
|
||||
'e',' ','u','s','e','d',' ','i','n',' ','c','o','n','s','t',
|
||||
'r','u','c','t','o','r','s',' ','o','n','l','y',#000,'E','_',
|
||||
'D','e','s','t','r','u','c','t','o','r','s',' ','c','a','n',
|
||||
#039,'t',' ','h','a','v','e',' ','p','a','r','a','m','e','t',
|
||||
'e','r','s',#000,'E','_','s','t','r','i','n','g',' ','t','y',
|
||||
'p','e','s',' ','d','o','e','s','n',#039,'t',' ','m','a','t',
|
||||
'c','h',',',' ','b','e','c','a','u','s','e',' ','o','f',' ',
|
||||
'$','V','+',' ','m','o','d','e',#000,'E','_','O','n','l','y',
|
||||
' ','c','l','a','s','s',' ','m','e','t','h','o','d','s',' ',
|
||||
'c','a','n',' ','b','e',' ','r','e','f','e','r','r','e','d',
|
||||
' ','w','i','t','h',' ','c','l','a','s','s',' ','r','e','f',
|
||||
'e','r','e','n','c','e','s',#000,'E','_','O','n','l','y',' ',
|
||||
'c','l','a','s','s',' ','m','e','t','h','o','d','s',' ','c',
|
||||
'a','n',' ','b','e',' ','a','c','c','e','s','s','e','d',' ',
|
||||
'i','n',' ','c','l','a','s','s',' ','m','e','t','h','o','d',
|
||||
's',#000,'E','_','C','o','n','s','t','a','n','t',' ','a','n',
|
||||
'd',' ','C','A','S','E',' ','t','y','p','e','s',' ','d','o',
|
||||
' ','n','o','t',' ','m','a','t','c','h',#000,'E','_','T','h',
|
||||
'e',' ','s','y','m','b','o','l',' ','c','a','n',#039,'t',' ',
|
||||
'b','e',' ','e','x','p','o','r','t','e','d',' ','f','r','o',
|
||||
'm',' ','a',' ','l','i','b','r','a','r','y',#000,'W','_','A',
|
||||
' ','i','n','h','e','r','i','t','e','d',' ','m','e','t','h',
|
||||
'o','d',' ','i','s',' ','h','i','d','d','e','n',' ','b','y',
|
||||
' ','$','1',#000,'E','_','T','h','e','r','e',' ','i','s',' ',
|
||||
'n','o',' ','m','e','t','h','o','d',' ','i','n',' ','a','n',
|
||||
' ','a','n','c','e','s','t','o','r',' ','c','l','a','s','s',
|
||||
' ','t','o',' ','b','e',' ','o','v','e','r','r','i','d','d',
|
||||
'e','n',':',' ','$','1',#000,'E','_','N','o',' ','m','e','m',
|
||||
'b','e','r',' ','i','s',' ','p','r','o','v','i','d','e','d',
|
||||
' ','t','o',' ','a','c','c','e','s','s',' ','p','r','o','p',
|
||||
'e','r','t','y',#000,'E','_','I','l','l','e','g','a','l',' ',
|
||||
's','y','m','b','o','l',' ','f','o','r',' ','p','r','o','p',
|
||||
'e','r','t','y',' ','a','c','c','e','s','s',#000,'E','_','C',
|
||||
'a','n','n','o','t',' ','w','r','i','t','e',' ','a',' ','p',
|
||||
'r','o','t','e','c','t','e','d',' ','f','i','e','l','d',' ',
|
||||
'o','f',' ','a','n',' ','o','b','j','e','c','t',#000,'E','_',
|
||||
'b','e',' ','V','I','R','T','U','A','L',#000,'W','_','C','o',
|
||||
'n','s','t','r','u','c','t','o','r',' ','s','h','o','u','l',
|
||||
'd',' ','b','e',' ','p','u','b','l','i','c',#000,'W','_','D',
|
||||
'e','s','t','r','u','c','t','o','r',' ','s','h','o','u','l',
|
||||
'd',' ','b','e',' ','p','u','b','l','i','c',#000,'N','_','C',
|
||||
'l','a','s','s',' ','s','h','o','u','l','d',' ','h','a','v',
|
||||
'e',' ','o','n','e',' ','d','e','s','t','r','u','c','t','o',
|
||||
'r',' ','o','n','l','y',#000,'E','_','L','o','c','a','l',' ',
|
||||
'c','l','a','s','s',' ','d','e','f','i','n','i','t','i','o',
|
||||
'n','s',' ','a','r','e',' ','n','o','t',' ','a','l','l','o',
|
||||
'w','e','d',#000,'E','_','A','n','o','n','y','m',' ','c','l',
|
||||
'a','s','s',' ','d','e','f','i','n','i','t','i','o','n','s',
|
||||
' ','a','r','e',' ','n','o','t',' ','a','l','l','o','w','e',
|
||||
'd',#000,'E','_','O','r','d','i','n','a','l',' ','v','a','l',
|
||||
'u','e',' ','e','x','p','e','c','t','e','d',#000,'E','_','I',
|
||||
'l','l','e','g','a','l',' ','p','a','r','a','m','e','t','e',
|
||||
'r',' ','l','i','s','t',#000,'E','_','o','v','e','r','l','o',
|
||||
'a','d','e','d',' ','i','d','e','n','t','i','f','i','e','r',
|
||||
' ','i','s','n',#039,'t',' ','a',' ','f','u','n','c','t','i',
|
||||
'o','n',' ','i','d','e','n','t','i','f','i','e','r',#000,'E',
|
||||
'_','o','v','e','r','l','o','a','d','e','d',' ','f','u','n',
|
||||
'c','t','i','o','n','s',' ','h','a','v','e',' ','t','h','e',
|
||||
' ','s','a','m','e',' ','p','a','r','a','m','e','t','e','r',
|
||||
' ','l','i','s','t',#000,'E','_','f','u','n','c','t','i','o',
|
||||
'n',' ','h','e','a','d','e','r',' ','d','o','e','s','n',#039,
|
||||
't',' ','m','a','t','c','h',' ','t','h','e',' ','f','o','r',
|
||||
'w','a','r','d',' ','d','e','c','l','a','r','a','t','i','o',
|
||||
'n',' ','$','1',#000,'N','_','o','n','l','y',' ','v','a','l',
|
||||
'u','e','s',' ','c','a','n',' ','b','e',' ','j','u','m','p',
|
||||
'e','d',' ','o','v','e','r',' ','i','n',' ','e','n','u','m',
|
||||
'e','r','a','t','i','o','n',' ','t','y','p','e','s',#000,'N',
|
||||
'_','I','n','t','e','r','f','a','c','e',' ','a','n','d',' ',
|
||||
'i','m','p','l','e','m','e','n','t','a','t','i','o','n',' ',
|
||||
'n','a','m','e','s',' ','a','r','e',' ','d','i','f','f','e',
|
||||
'r','e','n','t',' ','!',#000,'E','_','f','u','n','c','t','i',
|
||||
'o','n',' ','n','e','s','t','i','n','g',' ','>',' ','3','1',
|
||||
#000,'E','_','r','a','n','g','e',' ','c','h','e','c','k',' ',
|
||||
'e','r','r','o','r',' ','w','h','i','l','e',' ','e','v','a',
|
||||
'l','u','a','t','i','n','g',' ','c','o','n','s','t','a','n',
|
||||
't','s',#000,'E','_','p','o','i','n','t','e','r',' ','t','y',
|
||||
'p','e',' ','e','x','p','e','c','t','e','d',#000,'E','_','c',
|
||||
'l','a','s','s',' ','t','y','p','e',' ','e','x','p','e','c',
|
||||
't','e','d',#000,'E','_','d','u','p','l','i','c','a','t','e',
|
||||
' ','c','a','s','e',' ','l','a','b','e','l',#000,'E','_','t',
|
||||
'y','p','e','d',' ','c','o','n','s','t','a','n','t','s',' ',
|
||||
'o','f',' ','c','l','a','s','s','e','s',' ','a','r','e',' ',
|
||||
'n','o','t',' ','a','l','l','o','w','e','d',#000,'E','_','f',
|
||||
'u','n','c','t','i','o','n','s',' ','v','a','r','i','a','b',
|
||||
'l','e','s',' ','o','f',' ','o','v','e','r','l','o','a','d',
|
||||
'e','d',' ','f','u','n','c','t','i','o','n','s',' ','a','r',
|
||||
'e',' ','n','o','t',' ','a','l','l','o','w','e','d',#000,'E',
|
||||
'_','s','t','r','i','n','g',' ','l','e','n','g','t','h',' ',
|
||||
'm','u','s','t',' ','b','e',' ','a',' ','v','a','l','u','e',
|
||||
' ','f','r','o','m',' ','1',' ','t','o',' ','2','5','5',#000,
|
||||
'W','_','u','s','e',' ','e','x','t','e','n','d','e','d',' ',
|
||||
's','y','n','t','a','x',' ','o','f',' ','D','I','S','P','O',
|
||||
'S','E',' ','a','n','d',' ','N','E','W',' ','t','o',' ','g',
|
||||
'e','n','e','r','a','t','e',' ','i','n','s','t','a','n','c',
|
||||
'e','s',' ','o','f',' ','o','b','j','e','c','t','s',#000,'E',
|
||||
'_','c','l','a','s','s',' ','i','d','e','n','t','i','f','i',
|
||||
'e','r',' ','e','x','p','e','c','t','e','d',#000,'E','_','m',
|
||||
'e','t','h','o','d',' ','i','d','e','n','t','i','f','i','e',
|
||||
'r',' ','e','x','p','e','c','t','e','d',#000,'E','_','f','u',
|
||||
'n','c','t','i','o','n',' ','h','e','a','d','e','r',' ','d',
|
||||
'o','e','s','n',#039,'t',' ','m','a','t','c','h',' ','a','n',
|
||||
'y',' ','m','e','t','h','o','d',' ','o','f',' ','t','h','i',
|
||||
's',' ','c','l','a','s','s',#000,'P','_','p','r','o','c','e',
|
||||
'd','u','r','e','/','f','u','n','c','t','i','o','n',' ','$',
|
||||
'1',' ','(','$','2',')',' ','a','t',' ','l','i','n','e',' ',
|
||||
'$','3',#000,'E','_','I','l','l','e','g','a','l',' ','f','l',
|
||||
'o','a','t','i','n','g',' ','p','o','i','n','t',' ','c','o',
|
||||
'n','s','t','a','n','t',#000,'E','_','F','A','I','L',' ','c',
|
||||
'a','n',' ','b','e',' ','u','s','e','d',' ','i','n',' ','c',
|
||||
'o','n','s','t','r','u','c','t','o','r','s',' ','o','n','l',
|
||||
'y',#000,'E','_','D','e','s','t','r','u','c','t','o','r','s',
|
||||
' ','c','a','n',#039,'t',' ','h','a','v','e',' ','p','a','r',
|
||||
'a','m','e','t','e','r','s',#000,'E','_','s','t','r','i','n',
|
||||
'g',' ','t','y','p','e','s',' ','d','o','e','s','n',#039,'t',
|
||||
' ','m','a','t','c','h',',',' ','b','e','c','a','u','s','e',
|
||||
' ','o','f',' ','$','V','+',' ','m','o','d','e',#000,'E','_',
|
||||
'O','n','l','y',' ','c','l','a','s','s',' ','m','e','t','h',
|
||||
'o','d','s',' ','c','a','n',' ','b','e',' ','r','e','f','e',
|
||||
'r','r','e','d',' ','w','i','t','h',' ','c','l','a','s','s',
|
||||
' ','r','e','f','e','r','e','n','c','e','s',#000,'E','_','O',
|
||||
'n','l','y',' ','c','l','a','s','s',' ','m','e','t','h','o',
|
||||
'd','s',' ','c','a','n',' ','b','e',' ','a','c','c','e','s',
|
||||
's','e','d',' ','i','n',' ','c','l','a','s','s',' ','m','e',
|
||||
't','h','o','d','s',#000,'E','_','C','o','n','s','t','a','n',
|
||||
't',' ','a','n','d',' ','C','A','S','E',' ','t','y','p','e',
|
||||
's',' ','d','o',' ','n','o','t',' ','m','a','t','c','h',#000,
|
||||
'E','_','T','h','e',' ','s','y','m','b','o','l',' ','c','a',
|
||||
'n',#039,'t',' ','b','e',' ','e','x','p','o','r','t','e','d',
|
||||
' ','f','r','o','m',' ','a',' ','l','i','b','r','a','r','y',
|
||||
#000,'W','_','A',' ','i','n','h','e','r','i','t','e','d',' ',
|
||||
'm','e','t','h','o','d',' ','i','s',' ','h','i','d','d','e',
|
||||
'n',' ','b','y',' ','$','1',#000,'E','_','T','h','e','r','e',
|
||||
' ','i','s',' ','n','o',' ','m','e','t','h','o','d',' ','i',
|
||||
'n',' ','a','n',' ','a','n','c','e','s','t','o','r',' ','c',
|
||||
'l','a','s','s',' ','t','o',' ','b','e',' ','o','v','e','r',
|
||||
'r','i','d','d','e','n',':',' ','$','1',#000,'E','_','N','o',
|
||||
' ','m','e','m','b','e','r',' ','i','s',' ','p','r','o','v',
|
||||
'i','d','e','d',' ','t','o',' ','a','c','c','e','s','s',' ',
|
||||
'p','r','o','p','e','r','t','y',#000,'E','_','I','l','l','e',
|
||||
'g','a','l',' ','s','y','m','b','o','l',' ','f','o','r',' ',
|
||||
'p','r','o','p','e','r','t','y',' ','a','c','c','e','s','s',
|
||||
#000,'E','_','C','a','n','n','o','t',' ','a','c','c','e','s',
|
||||
's',' ','a',' ','p','r','o','t','e','c','t','e','d',' ','f',
|
||||
'i','e','l','d',' ','o','f',' ','a','n',' ','o','b','j','e',
|
||||
'c','t',' ','h','e','r','e',#000,'E','_','C','a','n','n','o',
|
||||
't',' ','a','c','c','e','s','s',' ','a',' ','p','r','i','v',
|
||||
'a','t','e',' ','f','i','e','l','d',' ','o','f',' ','a','n',
|
||||
' ','o','b','j','e','c','t',' ','h','e','r','e',#000,'E','_',
|
||||
'a','l','l',' ','o','v','e','r','l','o','a','d','e','d',' ',
|
||||
'm','e','t','h','o','d','s',' ','m','u','s','t',' ','b','e',
|
||||
' ','v','i','r','t','u','a','l',' ','i','f',' ','o','n','e',
|
||||
|
@ -525,6 +525,13 @@ unit pass_1;
|
||||
p^.registers32:=1;
|
||||
if p^.symtable^.symtabletype=withsymtable then
|
||||
p^.registers32:=1;
|
||||
{ check semantics of private }
|
||||
if p^.symtable^.symtabletype=objectsymtable then
|
||||
begin
|
||||
if (pobjectdef(pvarsym(p^.symtableentry)^.owner^.defowner)^.owner^.symtabletype=unitsymtable) and
|
||||
((p^.vs^.properties and sp_private)<>0) then
|
||||
Message(parser_e_cant_access_private_member);
|
||||
end;
|
||||
|
||||
{ a class variable is a pointer !!!
|
||||
yes, but we have to resolve the reference in an
|
||||
@ -3839,14 +3846,26 @@ unit pass_1;
|
||||
exit;
|
||||
|
||||
p^.resulttype:=p^.vs^.definition;
|
||||
{ this must be done in the parser
|
||||
if count_ref and not must_be_valid then
|
||||
if (p^.vs^.properties and sp_protected)<>0 then
|
||||
Message(parser_e_cant_write_protected_member);
|
||||
}
|
||||
p^.registers32:=p^.left^.registers32;
|
||||
p^.registersfpu:=p^.left^.registersfpu;
|
||||
{$ifdef SUPPORT_MMX}
|
||||
p^.registersmmx:=p^.left^.registersmmx;
|
||||
{$endif SUPPORT_MMX}
|
||||
{ check protected and private members }
|
||||
if (p^.left^.resulttype^.deftype=objectdef) then
|
||||
begin
|
||||
if (pobjectdef(p^.vs^.owner^.defowner)^.owner^.symtabletype=unitsymtable) and
|
||||
((p^.vs^.properties and sp_private)<>0) then
|
||||
Message(parser_e_cant_access_private_member);
|
||||
if (pobjectdef(p^.left^.resulttype)^.owner^.symtabletype=unitsymtable) and
|
||||
((p^.vs^.properties and sp_protected)<>0) then
|
||||
Message(parser_e_cant_access_protected_member);
|
||||
end;
|
||||
{ classes must be dereferenced implicit }
|
||||
if (p^.left^.resulttype^.deftype=objectdef) and
|
||||
pobjectdef(p^.left^.resulttype)^.isclass then
|
||||
@ -4827,7 +4846,13 @@ unit pass_1;
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.14 1998-04-30 15:59:41 pierre
|
||||
Revision 1.15 1998-05-01 09:01:23 florian
|
||||
+ correct semantics of private and protected
|
||||
* small fix in variable scope:
|
||||
a id can be used in a parameter list of a method, even it is used in
|
||||
an anchestor class as field id
|
||||
|
||||
Revision 1.14 1998/04/30 15:59:41 pierre
|
||||
* GDB works again better :
|
||||
correct type info in one pass
|
||||
+ UseTokenInfo for better source position
|
||||
|
@ -645,6 +645,11 @@ unit pdecl;
|
||||
|
||||
begin
|
||||
repeat
|
||||
if actmembertype=sp_private then
|
||||
aktclass^.options:=aktclass^.options or oo_hasprivate;
|
||||
if actmembertype=sp_protected then
|
||||
aktclass^.options:=aktclass^.options or oo_hasprotected;
|
||||
|
||||
case token of
|
||||
ID:
|
||||
begin
|
||||
@ -713,7 +718,7 @@ unit pdecl;
|
||||
_CONSTRUCTOR:
|
||||
begin
|
||||
if actmembertype<>sp_public then
|
||||
Message(parser_e_constructor_cannot_be_private);
|
||||
Message(parser_w_constructor_should_be_public);
|
||||
oldparse_only:=parse_only;
|
||||
parse_only:=true;
|
||||
constructor_head;
|
||||
@ -752,7 +757,7 @@ unit pdecl;
|
||||
there_is_a_destructor:=true;
|
||||
|
||||
if actmembertype<>sp_public then
|
||||
Message(parser_e_destructor_cannot_be_private);
|
||||
Message(parser_w_destructor_should_be_public);
|
||||
oldparse_only:=parse_only;
|
||||
parse_only:=true;
|
||||
destructor_head;
|
||||
@ -831,7 +836,7 @@ unit pdecl;
|
||||
(pobjectdef(hp1)^.options and oois_class)<>0)) then
|
||||
begin
|
||||
pcrd:=new(pclassrefdef,init(hp1));
|
||||
object_dec:=pcrd;
|
||||
object_dec:=pcrd;
|
||||
{I add big troubles here
|
||||
with var p : ^byte in graph.putimage
|
||||
because a save_forward was called and
|
||||
@ -1787,7 +1792,13 @@ unit pdecl;
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.14 1998-05-01 07:43:56 florian
|
||||
Revision 1.15 1998-05-01 09:01:23 florian
|
||||
+ correct semantics of private and protected
|
||||
* small fix in variable scope:
|
||||
a id can be used in a parameter list of a method, even it is used in
|
||||
an anchestor class as field id
|
||||
|
||||
Revision 1.14 1998/05/01 07:43:56 florian
|
||||
+ basics for rtti implemented
|
||||
+ switch $m (generate rtti for published sections)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user