htypechk.pas 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762
  1. {
  2. $Id$
  3. Copyright (c) 1996-98 by Florian Klaempfl
  4. This unit exports some help routines for the type checking
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. unit htypechk;
  19. interface
  20. uses
  21. tree,symtable;
  22. const
  23. { firstcallparan without varspez we don't count the ref }
  24. count_ref : boolean = true;
  25. get_para_resulttype : boolean = false;
  26. allow_array_constructor : boolean = false;
  27. { Conversion }
  28. function isconvertable(def_from,def_to : pdef;
  29. var doconv : tconverttype;fromtreetype : ttreetyp;
  30. explicit : boolean) : byte;
  31. { Register Allocation }
  32. procedure make_not_regable(p : ptree);
  33. procedure left_right_max(p : ptree);
  34. procedure calcregisters(p : ptree;r32,fpu,mmx : word);
  35. { subroutine handling }
  36. procedure test_protected_sym(sym : psym);
  37. procedure test_protected(p : ptree);
  38. function valid_for_formal_var(p : ptree) : boolean;
  39. function valid_for_formal_const(p : ptree) : boolean;
  40. function is_procsym_load(p:Ptree):boolean;
  41. function is_procsym_call(p:Ptree):boolean;
  42. function is_assignment_overloaded(from_def,to_def : pdef) : boolean;
  43. implementation
  44. uses
  45. globtype,systems,tokens,
  46. cobjects,verbose,globals,
  47. types,
  48. hcodegen;
  49. {****************************************************************************
  50. Convert
  51. ****************************************************************************}
  52. { Returns:
  53. 0 - Not convertable
  54. 1 - Convertable
  55. 2 - Convertable, but not first choice }
  56. function isconvertable(def_from,def_to : pdef;
  57. var doconv : tconverttype;fromtreetype : ttreetyp;
  58. explicit : boolean) : byte;
  59. { Tbasetype: uauto,uvoid,uchar,
  60. u8bit,u16bit,u32bit,
  61. s8bit,s16bit,s32,
  62. bool8bit,bool16bit,bool32bit,
  63. u64bit,s64bitint }
  64. type
  65. tbasedef=(bvoid,bchar,bint,bbool);
  66. const
  67. basedeftbl:array[tbasetype] of tbasedef =
  68. (bvoid,bvoid,bchar,
  69. bint,bint,bint,
  70. bint,bint,bint,
  71. bbool,bbool,bbool,bint,bint);
  72. basedefconverts : array[tbasedef,tbasedef] of tconverttype =
  73. ((tc_not_possible,tc_not_possible,tc_not_possible,tc_not_possible),
  74. (tc_not_possible,tc_equal,tc_not_possible,tc_not_possible),
  75. (tc_not_possible,tc_not_possible,tc_int_2_int,tc_int_2_bool),
  76. (tc_not_possible,tc_not_possible,tc_bool_2_int,tc_bool_2_bool));
  77. var
  78. b : byte;
  79. hd1,hd2 : pdef;
  80. begin
  81. { safety check }
  82. if not(assigned(def_from) and assigned(def_to)) then
  83. begin
  84. isconvertable:=0;
  85. exit;
  86. end;
  87. b:=0;
  88. { we walk the wanted (def_to) types and check then the def_from
  89. types if there is a conversion possible }
  90. case def_to^.deftype of
  91. orddef :
  92. begin
  93. case def_from^.deftype of
  94. orddef :
  95. begin
  96. doconv:=basedefconverts[basedeftbl[porddef(def_from)^.typ],basedeftbl[porddef(def_to)^.typ]];
  97. b:=1;
  98. if (doconv=tc_not_possible) or
  99. ((doconv=tc_int_2_bool) and
  100. (not explicit) and
  101. (not is_boolean(def_from))) or
  102. ((doconv=tc_bool_2_int) and
  103. (not explicit) and
  104. (not is_boolean(def_to))) then
  105. b:=0;
  106. end;
  107. enumdef :
  108. begin
  109. doconv:=tc_int_2_int;
  110. b:=1;
  111. end;
  112. end;
  113. end;
  114. stringdef :
  115. begin
  116. case def_from^.deftype of
  117. stringdef : begin
  118. doconv:=tc_string_2_string;
  119. b:=1;
  120. end;
  121. orddef : begin
  122. { char to string}
  123. if is_char(def_from) then
  124. begin
  125. doconv:=tc_char_2_string;
  126. b:=1;
  127. end;
  128. end;
  129. arraydef : begin
  130. { string to array of char, the length check is done by the firstpass of this node }
  131. if is_equal(parraydef(def_from)^.definition,cchardef) then
  132. begin
  133. doconv:=tc_chararray_2_string;
  134. if (not(cs_ansistrings in aktlocalswitches) and
  135. is_shortstring(def_to)) or
  136. ((cs_ansistrings in aktlocalswitches) and
  137. is_ansistring(def_to)) then
  138. b:=1
  139. else
  140. b:=2;
  141. end;
  142. end;
  143. pointerdef : begin
  144. { pchar can be assigned to short/ansistrings }
  145. if is_pchar(def_from) and not(m_tp in aktmodeswitches) then
  146. begin
  147. doconv:=tc_pchar_2_string;
  148. b:=1;
  149. end;
  150. end;
  151. end;
  152. end;
  153. floatdef :
  154. begin
  155. case def_from^.deftype of
  156. orddef : begin { ordinal to real }
  157. if is_integer(def_from) then
  158. begin
  159. if pfloatdef(def_to)^.typ=f32bit then
  160. doconv:=tc_int_2_fix
  161. else
  162. doconv:=tc_int_2_real;
  163. b:=1;
  164. end;
  165. end;
  166. floatdef : begin { 2 float types ? }
  167. if pfloatdef(def_from)^.typ=pfloatdef(def_to)^.typ then
  168. doconv:=tc_equal
  169. else
  170. begin
  171. if pfloatdef(def_from)^.typ=f32bit then
  172. doconv:=tc_fix_2_real
  173. else
  174. if pfloatdef(def_to)^.typ=f32bit then
  175. doconv:=tc_real_2_fix
  176. else
  177. doconv:=tc_real_2_real;
  178. end;
  179. b:=1;
  180. end;
  181. end;
  182. end;
  183. enumdef :
  184. begin
  185. if (def_from^.deftype=enumdef) then
  186. begin
  187. if assigned(penumdef(def_from)^.basedef) then
  188. hd1:=penumdef(def_from)^.basedef
  189. else
  190. hd1:=def_from;
  191. if assigned(penumdef(def_to)^.basedef) then
  192. hd2:=penumdef(def_to)^.basedef
  193. else
  194. hd2:=def_to;
  195. if (hd1=hd2) then
  196. b:=1;
  197. end;
  198. end;
  199. arraydef :
  200. begin
  201. { open array is also compatible with a single element of its base type }
  202. if is_open_array(def_to) and
  203. is_equal(parraydef(def_to)^.definition,def_from) then
  204. begin
  205. doconv:=tc_equal;
  206. b:=1;
  207. end
  208. else
  209. begin
  210. case def_from^.deftype of
  211. pointerdef : begin
  212. if (parraydef(def_to)^.lowrange=0) and
  213. is_equal(ppointerdef(def_from)^.definition,parraydef(def_to)^.definition) then
  214. begin
  215. doconv:=tc_pointer_2_array;
  216. b:=1;
  217. end;
  218. end;
  219. stringdef : begin
  220. { array of char to string }
  221. if is_equal(parraydef(def_to)^.definition,cchardef) then
  222. begin
  223. doconv:=tc_string_2_chararray;
  224. b:=1;
  225. end;
  226. end;
  227. end;
  228. end;
  229. end;
  230. pointerdef :
  231. begin
  232. case def_from^.deftype of
  233. stringdef : begin
  234. { string constant to zero terminated string constant }
  235. if (fromtreetype=stringconstn) and
  236. is_pchar(def_to) then
  237. begin
  238. doconv:=tc_cstring_2_pchar;
  239. b:=1;
  240. end;
  241. end;
  242. orddef : begin
  243. { char constant to zero terminated string constant }
  244. if (fromtreetype=ordconstn) and is_equal(def_from,cchardef) and
  245. is_pchar(def_to) then
  246. begin
  247. doconv:=tc_cchar_2_pchar;
  248. b:=1;
  249. end;
  250. end;
  251. arraydef : begin
  252. { chararray to pointer }
  253. if (parraydef(def_from)^.lowrange=0) and
  254. is_equal(parraydef(def_from)^.definition,ppointerdef(def_to)^.definition) then
  255. begin
  256. doconv:=tc_array_2_pointer;
  257. b:=1;
  258. end;
  259. end;
  260. pointerdef : begin
  261. { child class pointer can be assigned to anchestor pointers }
  262. if (
  263. (ppointerdef(def_from)^.definition^.deftype=objectdef) and
  264. (ppointerdef(def_to)^.definition^.deftype=objectdef) and
  265. pobjectdef(ppointerdef(def_from)^.definition)^.isrelated(
  266. pobjectdef(ppointerdef(def_to)^.definition))
  267. ) or
  268. { all pointers can be assigned to void-pointer }
  269. is_equal(ppointerdef(def_to)^.definition,voiddef) or
  270. { in my opnion, is this not clean pascal }
  271. { well, but it's handy to use, it isn't ? (FK) }
  272. is_equal(ppointerdef(def_from)^.definition,voiddef) then
  273. begin
  274. doconv:=tc_equal;
  275. b:=1;
  276. end;
  277. end;
  278. procvardef : begin
  279. { procedure variable can be assigned to an void pointer }
  280. { Not anymore. Use the @ operator now.}
  281. if not(m_tp_procvar in aktmodeswitches) and
  282. (ppointerdef(def_to)^.definition^.deftype=orddef) and
  283. (porddef(ppointerdef(def_to)^.definition)^.typ=uvoid) then
  284. begin
  285. doconv:=tc_equal;
  286. b:=1;
  287. end;
  288. end;
  289. classrefdef,
  290. objectdef : begin
  291. { class types and class reference type
  292. can be assigned to void pointers }
  293. if (
  294. ((def_from^.deftype=objectdef) and pobjectdef(def_from)^.isclass) or
  295. (def_from^.deftype=classrefdef)
  296. ) and
  297. (ppointerdef(def_to)^.definition^.deftype=orddef) and
  298. (porddef(ppointerdef(def_to)^.definition)^.typ=uvoid) then
  299. begin
  300. doconv:=tc_equal;
  301. b:=1;
  302. end;
  303. end;
  304. end;
  305. end;
  306. setdef :
  307. begin
  308. { automatic arrayconstructor -> set conversion }
  309. if (def_from^.deftype=arraydef) and (parraydef(def_from)^.IsConstructor) then
  310. begin
  311. doconv:=tc_arrayconstructor_2_set;
  312. b:=1;
  313. end;
  314. end;
  315. procvardef :
  316. begin
  317. { proc -> procvar }
  318. if (def_from^.deftype=procdef) then
  319. begin
  320. def_from^.deftype:=procvardef;
  321. doconv:=tc_proc_2_procvar;
  322. if is_equal(def_from,def_to) then
  323. b:=1;
  324. def_from^.deftype:=procdef;
  325. end
  326. else
  327. { for example delphi allows the assignement from pointers }
  328. { to procedure variables }
  329. if (m_pointer_2_procedure in aktmodeswitches) and
  330. (def_from^.deftype=pointerdef) and
  331. (ppointerdef(def_from)^.definition^.deftype=orddef) and
  332. (porddef(ppointerdef(def_from)^.definition)^.typ=uvoid) then
  333. begin
  334. doconv:=tc_equal;
  335. b:=1;
  336. end
  337. else
  338. { nil is compatible with procvars }
  339. if (fromtreetype=niln) then
  340. begin
  341. doconv:=tc_equal;
  342. b:=1;
  343. end;
  344. end;
  345. objectdef :
  346. begin
  347. { object pascal objects }
  348. if (def_from^.deftype=objectdef) {and
  349. pobjectdef(def_from)^.isclass and pobjectdef(def_to)^.isclass }then
  350. begin
  351. doconv:=tc_equal;
  352. if pobjectdef(def_from)^.isrelated(pobjectdef(def_to)) then
  353. b:=1;
  354. end
  355. else
  356. { nil is compatible with class instances }
  357. if (fromtreetype=niln) and (pobjectdef(def_to)^.isclass) then
  358. begin
  359. doconv:=tc_equal;
  360. b:=1;
  361. end;
  362. end;
  363. classrefdef :
  364. begin
  365. { class reference types }
  366. if (def_from^.deftype=classrefdef) then
  367. begin
  368. doconv:=tc_equal;
  369. if pobjectdef(pclassrefdef(def_from)^.definition)^.isrelated(
  370. pobjectdef(pclassrefdef(def_to)^.definition)) then
  371. b:=1;
  372. end
  373. else
  374. { nil is compatible with class references }
  375. if (fromtreetype=niln) then
  376. begin
  377. doconv:=tc_equal;
  378. b:=1;
  379. end;
  380. end;
  381. filedef :
  382. begin
  383. { typed files are all equal to the abstract file type
  384. name TYPEDFILE in system.pp in is_equal in types.pas
  385. the problem is that it sholud be also compatible to FILE
  386. but this would leed to a problem for ASSIGN RESET and REWRITE
  387. when trying to find the good overloaded function !!
  388. so all file function are doubled in system.pp
  389. this is not very beautiful !!}
  390. if (def_from^.deftype=filedef) and
  391. (
  392. (
  393. (pfiledef(def_from)^.filetype = ft_typed) and
  394. (pfiledef(def_to)^.filetype = ft_typed) and
  395. (
  396. (pfiledef(def_from)^.typed_as = pdef(voiddef)) or
  397. (pfiledef(def_to)^.typed_as = pdef(voiddef))
  398. )
  399. ) or
  400. (
  401. (
  402. (pfiledef(def_from)^.filetype = ft_untyped) and
  403. (pfiledef(def_to)^.filetype = ft_typed)
  404. ) or
  405. (
  406. (pfiledef(def_from)^.filetype = ft_typed) and
  407. (pfiledef(def_to)^.filetype = ft_untyped)
  408. )
  409. )
  410. ) then
  411. begin
  412. doconv:=tc_equal;
  413. b:=1;
  414. end
  415. end;
  416. else
  417. begin
  418. { assignment overwritten ?? }
  419. if is_assignment_overloaded(def_from,def_to) then
  420. b:=1;
  421. end;
  422. end;
  423. { nil is compatible with ansi- and wide strings }
  424. { no, that isn't true, (FK)
  425. if (fromtreetype=niln) and (def_to^.deftype=stringdef)
  426. and (pstringdef(def_to)^.string_typ in [st_ansistring,st_widestring]) then
  427. begin
  428. doconv:=tc_equal;
  429. b:=1;
  430. end
  431. else
  432. }
  433. { ansi- and wide strings can be assigned to void pointers }
  434. { no, (FK)
  435. if (def_from^.deftype=stringdef) and
  436. (pstringdef(def_from)^.string_typ in [st_ansistring,st_widestring]) and
  437. (def_to^.deftype=pointerdef) and
  438. (ppointerdef(def_to)^.definition^.deftype=orddef) and
  439. (porddef(ppointerdef(def_to)^.definition)^.typ=uvoid) then
  440. begin
  441. doconv:=tc_equal;
  442. b:=1;
  443. end
  444. else
  445. }
  446. { ansistrings can be assigned to pchar
  447. this needs an explicit type cast (FK)
  448. if is_ansistring(def_from) and
  449. (def_to^.deftype=pointerdef) and
  450. (ppointerdef(def_to)^.definition^.deftype=orddef) and
  451. (porddef(ppointerdef(def_to)^.definition)^.typ=uchar) then
  452. begin
  453. doconv:=tc_ansistring_2_pchar;
  454. b:=1;
  455. end
  456. else
  457. }
  458. isconvertable:=b;
  459. end;
  460. {****************************************************************************
  461. Register Calculation
  462. ****************************************************************************}
  463. { marks an lvalue as "unregable" }
  464. procedure make_not_regable(p : ptree);
  465. begin
  466. case p^.treetype of
  467. typeconvn :
  468. make_not_regable(p^.left);
  469. loadn :
  470. if p^.symtableentry^.typ=varsym then
  471. pvarsym(p^.symtableentry)^.var_options :=
  472. pvarsym(p^.symtableentry)^.var_options and not vo_regable;
  473. end;
  474. end;
  475. procedure left_right_max(p : ptree);
  476. begin
  477. if assigned(p^.left) then
  478. begin
  479. if assigned(p^.right) then
  480. begin
  481. p^.registers32:=max(p^.left^.registers32,p^.right^.registers32);
  482. p^.registersfpu:=max(p^.left^.registersfpu,p^.right^.registersfpu);
  483. {$ifdef SUPPORT_MMX}
  484. p^.registersmmx:=max(p^.left^.registersmmx,p^.right^.registersmmx);
  485. {$endif SUPPORT_MMX}
  486. end
  487. else
  488. begin
  489. p^.registers32:=p^.left^.registers32;
  490. p^.registersfpu:=p^.left^.registersfpu;
  491. {$ifdef SUPPORT_MMX}
  492. p^.registersmmx:=p^.left^.registersmmx;
  493. {$endif SUPPORT_MMX}
  494. end;
  495. end;
  496. end;
  497. { calculates the needed registers for a binary operator }
  498. procedure calcregisters(p : ptree;r32,fpu,mmx : word);
  499. begin
  500. left_right_max(p);
  501. { Only when the difference between the left and right registers < the
  502. wanted registers allocate the amount of registers }
  503. if assigned(p^.left) then
  504. begin
  505. if assigned(p^.right) then
  506. begin
  507. if (abs(p^.left^.registers32-p^.right^.registers32)<r32) then
  508. inc(p^.registers32,r32);
  509. if (abs(p^.left^.registersfpu-p^.right^.registersfpu)<fpu) then
  510. inc(p^.registersfpu,fpu);
  511. {$ifdef SUPPORT_MMX}
  512. if (abs(p^.left^.registersmmx-p^.right^.registersmmx)<mmx) then
  513. inc(p^.registersmmx,mmx);
  514. {$endif SUPPORT_MMX}
  515. end
  516. else
  517. begin
  518. if (p^.left^.registers32<r32) then
  519. inc(p^.registers32,r32);
  520. if (p^.left^.registersfpu<fpu) then
  521. inc(p^.registersfpu,fpu);
  522. {$ifdef SUPPORT_MMX}
  523. if (p^.left^.registersmmx<mmx) then
  524. inc(p^.registersmmx,mmx);
  525. {$endif SUPPORT_MMX}
  526. end;
  527. end;
  528. { error CGMessage, if more than 8 floating point }
  529. { registers are needed }
  530. if p^.registersfpu>8 then
  531. CGMessage(cg_e_too_complex_expr);
  532. end;
  533. {****************************************************************************
  534. Subroutine Handling
  535. ****************************************************************************}
  536. { protected field handling
  537. protected field can not appear in
  538. var parameters of function !!
  539. this can only be done after we have determined the
  540. overloaded function
  541. this is the reason why it is not in the parser, PM }
  542. procedure test_protected_sym(sym : psym);
  543. begin
  544. if ((sym^.properties and sp_protected)<>0) and
  545. ((sym^.owner^.symtabletype=unitsymtable) or
  546. ((sym^.owner^.symtabletype=objectsymtable) and
  547. (pobjectdef(sym^.owner^.defowner)^.owner^.symtabletype=unitsymtable))) then
  548. CGMessage(parser_e_cant_access_protected_member);
  549. end;
  550. procedure test_protected(p : ptree);
  551. begin
  552. case p^.treetype of
  553. loadn : test_protected_sym(p^.symtableentry);
  554. typeconvn : test_protected(p^.left);
  555. derefn : test_protected(p^.left);
  556. subscriptn : begin
  557. { test_protected(p^.left);
  558. Is a field of a protected var
  559. also protected ??? PM }
  560. test_protected_sym(p^.vs);
  561. end;
  562. end;
  563. end;
  564. function valid_for_formal_var(p : ptree) : boolean;
  565. var
  566. v : boolean;
  567. begin
  568. case p^.treetype of
  569. loadn : v:=(p^.symtableentry^.typ in [typedconstsym,varsym]);
  570. typeconvn : v:=valid_for_formal_var(p^.left);
  571. typen : v:=false;
  572. derefn,subscriptn,vecn,
  573. funcretn,selfn : v:=true;
  574. { procvars are callnodes first }
  575. calln : v:=assigned(p^.right) and not assigned(p^.left);
  576. { should this depend on mode ? }
  577. addrn : v:=true;
  578. { no other node accepted (PM) }
  579. else v:=false;
  580. end;
  581. valid_for_formal_var:=v;
  582. end;
  583. function valid_for_formal_const(p : ptree) : boolean;
  584. var
  585. v : boolean;
  586. begin
  587. { p must have been firstpass'd before }
  588. { accept about anything but not a statement ! }
  589. v:=true;
  590. if (p^.treetype in [calln,statementn]) then
  591. { if not assigned(p^.resulttype) or (p^.resulttype=pdef(voiddef)) then }
  592. v:=false;
  593. valid_for_formal_const:=v;
  594. end;
  595. function is_procsym_load(p:Ptree):boolean;
  596. begin
  597. is_procsym_load:=((p^.treetype=loadn) and (p^.symtableentry^.typ=procsym)) or
  598. ((p^.treetype=addrn) and (p^.left^.treetype=loadn)
  599. and (p^.left^.symtableentry^.typ=procsym)) ;
  600. end;
  601. { change a proc call to a procload for assignment to a procvar }
  602. { this can only happen for proc/function without arguments }
  603. function is_procsym_call(p:Ptree):boolean;
  604. begin
  605. is_procsym_call:=(p^.treetype=calln) and (p^.left=nil) and
  606. (((p^.symtableprocentry^.typ=procsym) and (p^.right=nil)) or
  607. ((p^.right<>nil) and (p^.right^.symtableprocentry^.typ=varsym)));
  608. end;
  609. function is_assignment_overloaded(from_def,to_def : pdef) : boolean;
  610. var
  611. passproc : pprocdef;
  612. convtyp : tconverttype;
  613. begin
  614. is_assignment_overloaded:=false;
  615. if assigned(overloaded_operators[assignment]) then
  616. passproc:=overloaded_operators[assignment]^.definition
  617. else
  618. exit;
  619. while passproc<>nil do
  620. begin
  621. if is_equal(passproc^.retdef,to_def) and
  622. (isconvertable(from_def,passproc^.para1^.data,convtyp,ordconstn,false)=1) then
  623. begin
  624. is_assignment_overloaded:=true;
  625. break;
  626. end;
  627. passproc:=passproc^.nextoverloaded;
  628. end;
  629. end;
  630. end.
  631. {
  632. $Log$
  633. Revision 1.23 1999-04-26 09:30:47 peter
  634. * small tp7 fix
  635. * fix void pointer with formaldef
  636. Revision 1.22 1999/04/21 22:00:01 pierre
  637. + valid_for_formal_var and valid_for_formal_const added
  638. Revision 1.21 1999/04/21 16:31:40 pierre
  639. ra386att.pas : problem with commit -m !
  640. Revision 1.20 1999/04/15 08:56:27 peter
  641. * fixed bool-bool conversion
  642. Revision 1.19 1999/03/24 23:17:02 peter
  643. * fixed bugs 212,222,225,227,229,231,233
  644. Revision 1.18 1999/03/06 17:25:19 peter
  645. * moved comp<->real warning so it doesn't occure everytime that
  646. isconvertable is called with
  647. Revision 1.17 1999/03/02 18:24:20 peter
  648. * fixed overloading of array of char
  649. Revision 1.16 1999/01/27 13:53:27 pierre
  650. htypechk.pas
  651. Revision 1.15 1999/01/27 13:12:10 pierre
  652. * bool to int must be explicit
  653. Revision 1.14 1999/01/19 15:55:32 pierre
  654. * fix for boolean to comp conversion (now disabled)
  655. Revision 1.13 1998/12/15 17:11:37 peter
  656. * string:=pchar not allowed in tp mode
  657. Revision 1.12 1998/12/11 00:03:18 peter
  658. + globtype,tokens,version unit splitted from globals
  659. Revision 1.11 1998/12/10 09:47:21 florian
  660. + basic operations with int64/qord (compiler with -dint64)
  661. + rtti of enumerations extended: names are now written
  662. Revision 1.10 1998/11/29 12:40:23 peter
  663. * newcnv -> not oldcnv
  664. Revision 1.9 1998/11/26 13:10:42 peter
  665. * new int - int conversion -dNEWCNV
  666. * some function renamings
  667. Revision 1.8 1998/11/17 00:36:42 peter
  668. * more ansistring fixes
  669. Revision 1.7 1998/10/14 13:33:24 peter
  670. * fixed small typo
  671. Revision 1.6 1998/10/14 12:53:38 peter
  672. * fixed small tp7 things
  673. * boolean:=longbool and longbool fixed
  674. Revision 1.5 1998/10/12 09:49:58 florian
  675. + support of <procedure var type>:=<pointer> in delphi mode added
  676. Revision 1.4 1998/09/30 16:42:52 peter
  677. * fixed bool-bool cnv
  678. Revision 1.3 1998/09/24 23:49:05 peter
  679. + aktmodeswitches
  680. Revision 1.2 1998/09/24 09:02:14 peter
  681. * rewritten isconvertable to use case
  682. * array of .. and single variable are compatible
  683. Revision 1.1 1998/09/23 20:42:22 peter
  684. * splitted pass_1
  685. }