March 01, 2009 should not compile | ||||
---|---|---|---|---|
| ||||
This code should not compile without any complain. class C { this(int t) {;} this() {;} this() {;} } void main() { new C(0); } OPTLINK (R) for Win32 Release 8.00.1 Copyright (C) Digital Mars 1989-2004 All rights reserved. test2.obj(test2) Offset 002D6H Record Type 00C3 Error 1: Previous Definition Different : _D5test21C5_ctorMFZC5test21C --- errorlevel 1 |
March 01, 2009 Re: should not compile | ||||
---|---|---|---|---|
| ||||
Posted in reply to M. Z. Hossain | On Sun, Mar 1, 2009 at 11:19 AM, M. Z. Hossain <z_hossain@icmail.net> wrote:
> This code should not compile without any complain.
>
> class C {
>
> this(int t) {;}
> this() {;}
>
> this() {;}
> }
>
> void main() {
> new C(0);
> }
>
>
> OPTLINK (R) for Win32 Release 8.00.1
> Copyright (C) Digital Mars 1989-2004 All rights reserved.
> test2.obj(test2) Offset 002D6H Record Type 00C3
> Error 1: Previous Definition Different : _D5test21C5_ctorMFZC5test21C
> --- errorlevel 1
No, it should compile with a complaint, except the compiler should be the one complaining, not the linker.
|
Copyright © 1999-2021 by the D Language Foundation