Thread overview |
---|
October 15, 2003 BUG ? duplicated ctors? | ||||
---|---|---|---|---|
| ||||
(let's try again with better subject. sorry for the (re)repetition) this compiles with flag '-c': class Dup { this(){} this(char[] good){} this(char[] bad){} } void main() { new Dup; } if the empty ctor is removed the compilation fails. if the instanciation is removed, it compiles even without the empty ctor. when adding to a lib a warning "already in library, redefinition ignored" (the DM linker?) is printed but seems the first one got in. (the linux ar rcs libdui.a .... doesn't throw any warning because of the 'r' in rcs) (thanks to J C Calvarese for finding this on DUI) Ant |
October 17, 2003 Re: BUG ? duplicated ctors? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ant | "Ant" <Ant_member@pathlink.com> wrote in message news:bmistk$22pm$1@digitaldaemon.com... > (let's try again with better subject. sorry for the (re)repetition) > > this compiles with flag '-c': > > class Dup > { > this(){} > this(char[] good){} > this(char[] bad){} > } > void main() > { > new Dup; > } > > if the empty ctor is removed the compilation fails. Correct. > if the instanciation is removed, it compiles even without the empty ctor. Correct. > when adding to a lib a warning > "already in library, redefinition ignored" (the DM linker?) > is printed but seems the first one got in. Try removing the module from the library, and adding it again. > (the linux > ar rcs libdui.a .... > doesn't throw any warning because of the 'r' in rcs) > > (thanks to J C Calvarese for finding this on DUI) > > Ant > > |
October 17, 2003 Re: BUG ? duplicated ctors? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | In article <bmoa28$3er$3@digitaldaemon.com>, Walter says... > > >"Ant" <Ant_member@pathlink.com> wrote in message news:bmistk$22pm$1@digitaldaemon.com... >> (let's try again with better subject. sorry for the (re)repetition) >> >> this compiles with flag '-c': >> >> class Dup >> { >> this(){} >> this(char[] good){} >> this(char[] bad){} >> } >> void main() >> { >> new Dup; >> } >> >> if the empty ctor is removed the compilation fails. > >Correct. [...] >Correct. Sorry, the answer is too concise, I don't get it. Is that the expected behaviour of the compiler? a similar thing hapens with methods instead of ctors: void that(char[] good){}; void that(char[] bad){}; I would say this is a problem with the '-c' flag.(?) Or is it expected that the compiler doesn't check for duplicated methods with the '-c' flag? !!!! Ant |
October 17, 2003 Re: BUG ? duplicated ctors? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ant | "Ant" <Ant_member@pathlink.com> wrote in message news:bmosnj$rg2$1@digitaldaemon.com... > In article <bmoa28$3er$3@digitaldaemon.com>, Walter says... > > > > > >"Ant" <Ant_member@pathlink.com> wrote in message news:bmistk$22pm$1@digitaldaemon.com... > >> (let's try again with better subject. sorry for the (re)repetition) > >> > >> this compiles with flag '-c': > >> > >> class Dup > >> { > >> this(){} > >> this(char[] good){} > >> this(char[] bad){} > >> } > >> void main() > >> { > >> new Dup; > >> } > >> > >> if the empty ctor is removed the compilation fails. > > > >Correct. > [...] > >Correct. > > Sorry, the answer is too concise, I don't get it. > Is that the expected behaviour of the compiler? > a similar thing hapens with methods instead of ctors: > void that(char[] good){}; > void that(char[] bad){}; Oh, I see now what's wrong. Sorry. It does look like a bug. -Walter |
Copyright © 1999-2021 by the D Language Foundation