www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Forward reference hell in the DWT. Obviously it's a bug.

reply "Blandger" <zeroman aport.ru> writes:
Here is a full subject story
http://www.dsource.org/forums/viewtopic.php?t=228

I attached the archived source for the 'simplified DWT' version what was
stripped from the real DWT for eliminatig the problem of  D compiler.

The archive has a three version of the same widget classes.

Source folders in it are
\src_fine - is tweaked version. It doesn't have any errors and can be
linked.
\src_crash - crashes the DMD 0.94 and previous versions too
\src_f_ref - gives the forward reference. I can say error description is far
from the clarity and as for me it doesn't give a clue for solving the
problem.

The main difference between those three sources can be found in the
control.d and widget.d files. The 'private import' directive position is
really make sence.

Hope the source will help you Walter to fix a bug because DWT stuck with it
and can't efficiently go further.

Regards, Yuriy.



begin 666 simplified_dwt_f_ref_error.zip


M` ```+PYV3 ````````````````6````<W)C7V-R87-H+V1W="]W:61G971S
M+U!+`P04``(`" `F2;XP'?.]'YL````E`0``(0```'-R8U]C<F%S:"]D=W0O
M=VED9V5T<R]C;VUP;W-I=&4N9(V-,0^"0 Q&9_HK.F)B8)>1U<W1.!S'19L4
M[G(M$D/X[YX2,"[&K?GZ\AYTOAW883MJ,5)[=2J%]5WP0NHJ !#I;M0AI2GJ
M%R8V>F;3<.)^8-;WFL"7:VB8+%HV(EBO$3S :3/A!%"6?]FR>CGQ?$$US9%$






MOC"F>]HU= ```,P````?````<W)C7V-R87-H+V1W="]W:61G971S+V1I<W!L
M87DN9./ERLU/*<U)54 I+]$KSTQ)3RTIUDO)+"[(2:RTYN4"07W] J+,LL22

M* !-*/'(+"E)+2YQQK2 )".S6$,39'(M2+06XDQ>+ !02P,$% `"`` `N$6^
M,.*2:.*4````& $``"(```!S<F-?8W)A<V O9'=T+W=I9&=E=',O<V-R;VQL
M86)L92YDA8Y!#H(P$$77]A2SQ,3 7I8<P1.4,M%)AK;I3"6&<'<;"! WNOW_
MY?UOQC!D1A FK2<:[JA2BTN!V?:,K3$QT=,J`HTQ)/WB7/!:R-8TS4^J9$*Z
MRG+/Y,#VHLDZ!<=6!&[''ERAVZ0P_YG^2/5!4IUA7 [_FG0[`M$F]'H!\ JB
M+\8"E\\GR1$35'N]5:TIGL6\`5!+`P04``(`" "!0[XP[]]]&Y,````1`0``

M'ENI  . ;KU#YY!$K:4`46R*$.+N34,HZM;)]O?W^X9NL*-W:">I)K(/)UQJ

M3;T R^Q=6LN3^'3&984],"LE)NCH>KG ]R(Y07T<51[QNH-4P2=E.SI>2. 5
MWE!+`P04``(`" !81;XPMYP`G',```"3````% ```'-R8U]C<F%S:"]30V]N
M<W1R=6-TX^5**\K/54C/R4]2R,PMR"\J`;-YN:"<_&(XL[ 2R.;E2LTK4[!5
M<,TKRRS*S\M-S2O1</4+L\TOUDN%"&F"% 4'.0,5:?!R*0`!R$ -]93R$OWR
MS)3TU))B?2V]%'5-!5XN3:B!> %%^>E%B;D:0'V:`%!+`P04``(```"\.=DP
M````````````````" ```'-R8U]F7W)E9B]02P,$% `"`` `9$6^,+><`)QS
M````DP```!0```!S<F-?9E]R968O4T-O;G-T<G5C=./E2BO*SU5(S\E/4LC,


M1?GI18FY&D!]F !02P,$% `"````O#G9, ````````````````X```!S<F-?
M9E]R968O9'=T+U!+`P04``(```"\.=DP````````````````% ```'-R8U]F
M7W)E9B]D=W0O=VED9V5T<R]02P,$% `"`` `X9O>,!WSO1^;````)0$``"$`
M``!S<F-?9E]R968O9'=T+W=I9&=E=',O8V]M<&]S:71E+F2-C3$/ D ,1F?Z

MA?5=\$+J*H 0Z6[4(:4IZA<F-GIFTW#B
MX010EG_9LGHY\7Q!-<V11-.J-Y)\A].\Y=[+IQ9,=+WND7I%T0>[!*=D)D-P
M$?/UO;PJ2)X9GE!+`P04``(`" ";2KXP?6CXNYT````W`0``'P```'-R8U]F
M7W)E9B]D=W0O=VED9V5T<R]C;VYT<F]L+F2-CD$. D ,1=?T%%UB,+"7N.(0

MHU5"[KT+^ &E7O]"C(N:L-+J-%XM&S2V%<$F!> )+QN*,T!5_>F4-?N O TT
MQ!] [RSY`><E^A1[UB9^PT?D05'T:2GRD,GH*6"^+].BAFP]+I.*YW?0`D4%

M="]W:61G971S+V1I<W!L87DN9./ERLU/*<U)54 I+]$KSTQ)3RTIUDO)+"[(
M2:RTYN4"07W] J+,LL225(7,W(+\HA(4I<GY>25%^3E I06E23F9R0K).8G%

M+ !02P,$% `"`` `Q)O>,.*2:.*4````& $``"(```!S<F-?9E]R968O9'=T
M+W=I9&=E=',O<V-R;VQL86)L92YDA8Y!#H(P$$77]A2SQ,3 7I8<P1.4,M%)
MAK;I3"6&<'<;"! WNOW_Y?UOQC!D1A FK2<:[JA2BTN!V?:,K3$QT=,J`HTQ
M)/WB7/!:R-8TS4^J9$*ZRG+/Y,#VHLDZ!<=6!&[''ERAVZ0P_YG^2/5!4IUA
M7 [_FG0[`M$F]'H!\ JB+\8"E\\GR1$35'N]5:TIGL6\`5!+`P04``(`" "'
M.KXPB:RQT9,````1`0``' ```'-R8U]F7W)E9B]D=W0O=VED9V5T<R]W:61G



M51[QNH-4P2=E.SI>2. 5WE!+`P04``(```"\.=DP````````````````"0``
M`'-R8U]F:6YE+U!+`P04``(`" !O1;XPMYP`G',```"3````$P```'-R8U]F

MYN5*S2M3L%5PS2O++,K/RTW-*]%P]0NSS2_62X4(:8(4!0<Y`Q5I\'(I``'(

M` ```+PYV3 ````````````````-````<W)C7V9I;F4O9'=T+U!+`P04``(`
M``"\.=DP````````````````%0```'-R8U]F:6YE+V1W="]W:61G971S+U!+
M`P04``(`" "O.+XP'?.]'YL````E`0``( ```'-R8U]F:6YE+V1W="]W:61G
M971S+V-O;7!O<VET92YDC8TQ#X
M0_COGA(P+L:M^?KR'G2^'=AA.VHQ4GMU*H7U7?!"ZBJ $.ENU"&E*>H7)C9Z
M9M-PXGY UO>:P)=K:) L6C8B6*\1/.!I,^$$4)9_V;)Z.?%\037-D433JC>2

M#IS>,!7_$V&>````-P$``!X```!S<F-?9FEN92]D=W0O=VED9V5T<R]C;VYT
M<F]L+F1]CC$. S ,16=\"H]45&0OZL0A.M,0M98"B6(#JA!W;R"B:CNPV/+W




MRLU/*<U)54 I+]$KSTQ)3RTIUDO)+"[(2:RTYN4"07W] J+,LL225(7,W(+\

M+"E)+2YQQK2 )".S6$,39'(M2+06XDQ>+ !02P,$% `"`` `:CB^,.*2:.*4
M````& $``"$```!S<F-?9FEN92]D=W0O=VED9V5T<R]S8W)O;&QA8FQE+F2%

M&":M)QKNJ%*+2X'9]HRM,3'1TRH"C3$D_>)<\%K(UC3-3ZID0KK*<L_DP/:B


M7V9I;F4O9'=T+W=I9&=E=',O=VED9V5T+F2-CC$. S ,1>?X%!Y;J8(#H&Z]
M0^>01*VE`%%LBA#B
MZL(0Y<=EB8/7<P,*PMAZ,JA;EJB-H/&:&>_9B O /Q10MZW%`TR](,OL75K+


M87-H+U!+`0(4`!0`` ```+PYV3 ````````````````.````````````, ``
M`" ```!S<F-?8W)A<V O9'=T+U!+`0(4`!0`` ```+PYV3 `````````````
M```6````````````, ```%0```!S<F-?8W)A<V O9'=T+W=I9&=E=',O4$L!
M`A0`% `"`` `)DF^,!WSO1^;````)0$``"$```````````` ````B ```'-R
M8U]C<F%S:"]D=W0O=VED9V5T<R]C;VUP;W-I=&4N9%!+`0(4`!0`` `(`""<

M+W=I9&=E=',O8V]N=')O;"YD4$L!`A0`% `"`` `R46^,*9[VC5V````S ``
M`!\```````````` ````/0(``'-R8U]C<F%S:"]D=W0O=VED9V5T<R]D:7-P
M;&%Y+F102P$"% `4``(`" "X1;XPXI)HXI0````8`0``( ```````````" `
M``#P` ``<W)C7V-R87-H+V1W="]W:61G971S+W-C<F]L;&%B;&4N9%!+`0(4
M`!0`` `(`(%#OC#OWWT
M8W)A<V O9'=T+W=I9&=E=',O=VED9V5T+F102P$"% `4``(`" !81;XPMYP`


M!0``<W)C7V9?<F5F+U!+`0(4`!0`` `(`&1%OC"WG "<<P```),````4````
M````````( ```& %``!S<F-?9E]R968O4T-O;G-T<G5C=%!+`0(4`!0`` ``
M`+PYV3 ````````````````.````````````, ````4&``!S<F-?9E]R968O
M9'=T+U!+`0(4`!0`` ```+PYV3 ````````````````6````````````, ``

MO1^;````)0$``"$```````````` ````908``'-R8U]F7W)E9B]D=W0O=VED


M;"YD4$L!`A0`% `"`` `93J^,*9[VC5V````S ```!\```````````` ````
M&0 ``'-R8U]F7W)E9B]D=W0O=VED9V5T<R]D:7-P;&%Y+F102P$"% `4``(`

M+V1W="]W:61G971S+W-C<F]L;&%B;&4N9%!+`0(4`!0`` `(`(<ZOC")K+'1
MDP```!$!```>````````````( ```* )``!S<F-?9E]R968O9'=T+W=I9&=E
M=',O=VED9V5T+F102P$"% `4``(```"\.=DP````````````````"0``````



M7V9I;F4O9'=T+U!+`0(4`!0`` ```+PYV3 ````````````````5````````
M````, ```&4+``!S<F-?9FEN92]D=W0O=VED9V5T<R]02P$"% `4``(`" "O
M.+XP'?.]'YL````E`0``( ```````````" ```"8"P``<W)C7V9I;F4O9'=T
M+W=I9&=E=',O8V]M<&]S:71E+F102P$"% `4``(`" `.G-XP%?\389X````W

M=')O;"YD4$L!`A0`% `"`` `1$6^,*9[VC5V````S ```!X```````````` 
M````2PT``'-R8U]F:6YE+V1W="]W:61G971S+V1I<W!L87DN9%!+`0(4`!0`
M` `(`&HXOC#BDFCBE ```! !```A````````````( ```/T-``!S<F-?9FEN
M92]D=W0O=VED9V5T<R]S8W)O;&QA8FQE+F102P$"% `4``(`" "].+XPB:RQ

A=',O=VED9V5T+F102P4&`````!L`&P!T!P``G \`````
`
end
Jun 30 2004
next sibling parent reply J C Calvarese <jcc7 cox.net> writes:
Since not everyone uses SCons (which requires Python), some people might 
find it helpful to have a batch file. This seemed to work for me:

 rem *** build.bat ***
 echo off
cd dwt
cd widgets
dmd composite.d -c -I..\..
dmd control.d -c -I..\..
dmd display.d -c -I..\..
dmd scrollable.d -c -I..\..
dmd widget.d -c -I..\..
pause


I put a copy of this batch file in each of the three main folders.
In src_fine, DMD seemed to work fine.
In src_crash, DMD gave me a GPF.
In src_f_ref, DMD gave me this message (several times):

..\..\dwt\widgets\scrollable.d(7): class Scrollable is forward referenced


Blandger wrote:
 Here is a full subject story
 http://www.dsource.org/forums/viewtopic.php?t=228
 
 I attached the archived source for the 'simplified DWT' version what was
 stripped from the real DWT for eliminatig the problem of  D compiler.
 
 The archive has a three version of the same widget classes.
 
 Source folders in it are
 \src_fine - is tweaked version. It doesn't have any errors and can be
 linked.
So the files can be tweaked, but it takes a lot of effort? I suppose it becomes more and more difficult with more and more files. Thus, DWT would be practically impossible to completely compile. :(
 \src_crash - crashes the DMD 0.94 and previous versions too
I didn't realize any of this stuff crashed! That seems a lot more severe than the "forward reference" error message to me.
 \src_f_ref - gives the forward reference. I can say error description is far
 from the clarity and as for me it doesn't give a clue for solving the
 problem.
That's unfortunate. If the error message is vague or misleading, it's not much better than a crash.
 
 The main difference between those three sources can be found in the
 control.d and widget.d files. The 'private import' directive position is
 really make sence.
 
 Hope the source will help you Walter to fix a bug because DWT stuck with it
 and can't efficiently go further.
 
 Regards, Yuriy.
-- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/
Jun 30 2004
parent "Blandger" <zeroman aport.ru> writes:
 Since not everyone uses SCons (which requires Python), some people might
 find it helpful to have a batch file. This seemed to work for me:
Thanks Justin for this accompaniment. Using Scons is natural to me after I tried it.
 I put a copy of this batch file in each of the three main folders.
 In src_fine, DMD seemed to work fine.
 In src_crash, DMD gave me a GPF.
 In src_f_ref, DMD gave me this message (several times):
 ..\..\dwt\widgets\scrollable.d(7): class Scrollable is forward referenced
That's it.
 So the files can be tweaked, but it takes a lot of effort?
This 'import' placement combination was found using 'brute force', moving imports one by one in those 5 files. I tried to find the rules which can help solving f.ref. but failed.
 I suppose it becomes more and more difficult with more and more files.
 Thus, DWT would be practically impossible to completely compile. :(
You absolutely right.
 \src_crash - crashes the DMD 0.94 and previous versions too
I didn't realize any of this stuff crashed! That seems a lot more severe than the "forward reference" error message to me.
As you see GPF on compiling last file - widget.d
 \src_f_ref - gives the forward reference. I can say error description is
far
 from the clarity and as for me it doesn't give a clue for solving the
 problem.
That's unfortunate. If the error message is vague or misleading, it's not much better than a crash.
Agree. Regards, Yuriy.
Jun 30 2004
prev sibling parent reply Ant <duitoolkit yahoo.ca> writes:
On Wed, 30 Jun 2004 20:22:07 +0300, Blandger wrote:

 Here is a full subject story
 http://www.dsource.org/forums/viewtopic.php?t=228
 
 I attached the archived source for the 'simplified DWT' version what was
 stripped from the real DWT for eliminatig the problem of  D compiler.
$ dmd dwt/*/* -I~/dmd/src/phobos -c compiles all the source trees with no problem - linux 0.94. (read discussion "make utility NOT needed" (or similar) on the old ng) but you are converting from java why don't you have all the imports inside the class bodies? (except the super classes/interfaces) that fails only for the free functions modules. related: people are reporting that DUI compiles with 0.93 and 0.94. Walter, did you change the imports on 0.93? or how the free functions scope if accessed? Ant
Jun 30 2004
parent "Blandger" <zeroman prominvest.com.ua> writes:
 $ dmd dwt/*/* -I~/dmd/src/phobos -c
Very strange dmd composite.d control.d display.d scrollable.d widget.d compiles fine for all three source trees.
 but you are converting from java why don't you have all the
 imports inside the class bodies? (except the super classes/interfaces)
 that fails only for the free functions modules.
I don't remember for all DWT code now but almost all classes have private import inside the class body. But this time it doesn't help avoid forward reference in \dwt\widgets\* classes. Yuriy.
Jul 01 2004