www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - template specialization bug

reply "Aleksey Bobnev" <uw front.ru> writes:
Specialization gets broken sometimes. It's possibly related to module
facility in D.

this works ok(outputs "1 0"):

template IsArray(T)        { static const bool IsArray = false; }
template IsArray(T : T[])  { static const bool IsArray = true; }

void main()
{
    printf("%d %d\n",IsArray!(int[]),IsArray!(int));
}

1. When some module, containing a bunch templates is imported,output is "0
0".
2. When template IsArray is moved into another module, containing other
templates as well,  output is "0 0".

However when I tried to isolate the bug by removing uninvolved templates, it
disappeared.
So I am including the complete code which causes the described behaviour.


begin 666 thor_bug.zip

MX2P4$O )+ Z.[MVTPV^30B!-2O(KE-)W-V(=Q,';[KC[CNTX>6*+<SZE1+-J
M-38MR$SL>O0Q9,8M1O]IX8B!?+8-5BE^$3B O73Z'X+3_4V0XA&=P4 N*"W%
M\DI0-"47>%!5;5";:ZCVVW:G2EX.OKS6C13K$U!+`P0*``````"7EIDQ````

M````5&AO<B]M971A+F2-D,U.`C$4A?>3S#N<L.)7P. &X )%5V!,G!?H="[0


MB'8_96IML=1P>A2BB<H,B1KTP>JCY:776G YEN7"L%024JW7:,QU1D;AH=/!



MYET<R3 IF/7AH?H/"D;!^!1M>)DVJ9L[J;U%-QQ."X:YR\R#XH&-D_#A,?P'


M6;9FDIJD+T8Z_^Y_?Y].GHV'`P" :*,(IK"$!S0L)[4FEF5<KN&>Q\2H=-0.
M27,EX2^2<I$ ">'#U=7':?7X!'.!6XTEW*E8XFXX<,QC$0N>P%)EC$L7:HLR

M6IY!E0'W:LM!.-->LH2OQ%&C;+5R4KG2+3>!WQN>;( EIF!"E)!S)1$)4\C0


MCXI+ W3$4(OU6O*$,S4^2:W?U;?X%R;FF"E']7GR0&W)+4_1ZW/U16"&TD1E

M<H=D[)V-E(\G3%;R,4+B7F,*1L'3Y_9OX57W!(*GT %-B<Z)V;/:Q_T(./KU
MN+SMX7M+&"I\!?M7Z_2PO6>CJB_ W?JF^][/O"/:79?Q`^B09E,17>8["DSJ
M&1D%05,HG'1&QR9/]JBF6#AQ



MY?K<<XXMZW+XNM\#O,A,*CB &_C -$V4G"H:13R>PIA/%%4+DS5G*N4RAI],
M21,9! Z,AL/C`_PZ 2O![E*V '=R$K-YOV=R/F43P0.XD1'EL0DMB]+X+H6I
M!"TO3. J#A7C.

MT(Z#AW
M'B;=8QY^`D'3% A.'N/D: (5G*;P,1."P.WE:HR4,<VB1& E&+-XJF<#QX0+


M2LYY$"<WNKQKY%J"_17)68/D_*%OI*T79EQ:567B37%P? FU H-/UZ,4MO+P
MD\+U6+LEYI*'CQ)7]Z$NGAJG'"\Q65BL<O+!].7FJ1+N-Y-Z'I&21<,BU4HT

M<LW]77F_= TYQS%GTU)%D3[X>HO0+JXT`O]U!<TYE.<^>%SWKMPO!1 >2_6X


M );85$%"%8V89BJMZW>);\\"CXSW!EB =1=&:UQ8%>>2D75]6*-]B4?;2'3)
M41<JL4S[0H^W%.J2XXZT8J7VY9YL+]<E)]TIQF+MBSY]EFB7G':J&^NU+_WL

M9AS96-R"*WXKKN"PW],]0<!"S^>/6G,'1R==X5,D++2-_E&K+N'HJK-\DHB%

M%W'LHOMN1,Q"C^Z?6W<3QXYZ^6;D++3\_LM[_B;$<>SNW: A00OO$*,U[Q"_
M`5!+`P04````" "VEIDQ$K9G4),```#I````" ```'=R;VYG,2YDA8_!"L(P

M/GP\T!RT-8E:5K&*]!2L(HU+.L>H9BX%-BU(I,CTZ+U+A+OW]C.%$T9EDVZQ



M[SCSK,E/.0+"[,B(09.5"F%%$"$CD_6=C!,C$M/8."VG EDOD0R\;M6G*Y7_

M``````````` `````````&]K+F102P$"% `*``````"7EIDQ````````````
M````!0```````````! ```"C````5&AO<B]02P$"% `4````" `\E9DQ=Q<&


M<F%I=',N9%!+`0(4`!0````(`"F6F3%O(MI0O0,``( >```/````````````
M( ```+0$``!4:&]R+W1Y<&5L:7-T+F102P$"% `4````" "VEIDQ$K9G4),`
M``#I````" ```````````" ```">" ``=W)O;F<Q+F102P$"% `4````" !"
MA9LQ,1YIAFH```"D````" ```````````" ```!7"0``=W)O;F<R+F102P4&
2``````<`!P""`0``YPD`````
`
end
Dec 27 2004
parent "Thomas Kuehne" <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Added to DStress as
http://dstress.kuehne.cn/run/template_10.d
http://dstress.kuehne.cn/run/template_11.d
http://dstress.kuehne.cn/run/template_12.d

Thomas


-----BEGIN PGP SIGNATURE-----

iD8DBQFB1ixn3w+/yD4P9tIRAubFAKC2Hpcw8S1eKC0qUs825IzIIOKXEwCguO3e
w+IkzgTEGHGbOHUF5GOKJ9U=
=oS/a
-----END PGP SIGNATURE-----
Dec 31 2004