Thread overview
[Issue 13184] better error messages for incorrect constructors
Apr 18, 2018
RazvanN
Apr 18, 2018
Mike Franklin
Apr 18, 2018
RazvanN
Apr 19, 2018
Manu
Dec 17, 2022
Iain Buclaw
April 18, 2018
https://issues.dlang.org/show_bug.cgi?id=13184

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |razvan.nitu1305@gmail.com

--- Comment #1 from RazvanN <razvan.nitu1305@gmail.com> ---
It seems that __gshared is ignored when applied to a constructor, which seems to be in trend with how D usually treats identifiers which are used where they not supposed to. The same happens with extern(C) :

struct S
{
    extern (C) void foo() {}
}

This code will compiler even though it doesn't make any sense to mark a struct
function as extern(C).

I would say we should close this as wontfix.

--
April 18, 2018
https://issues.dlang.org/show_bug.cgi?id=13184

Mike Franklin <slavo5150@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |slavo5150@yahoo.com

--- Comment #2 from Mike Franklin <slavo5150@yahoo.com> ---
(In reply to RazvanN from comment #1)
> It seems that __gshared is ignored when applied to a constructor, which seems to be in trend with how D usually treats identifiers which are used where they not supposed to. The same happens with extern(C) :

Yes, that does seem to be the trend, and I don't like it.  `static` methods at the module level is another; the `static` is pointless, but the compiler doesn't seem to mind.

I would prefer that, if a token is meaningless, the compiler emit an error.

--
April 18, 2018
https://issues.dlang.org/show_bug.cgi?id=13184

--- Comment #3 from RazvanN <razvan.nitu1305@gmail.com> ---
(In reply to Mike Franklin from comment #2)
> (In reply to RazvanN from comment #1)
> > It seems that __gshared is ignored when applied to a constructor, which seems to be in trend with how D usually treats identifiers which are used where they not supposed to. The same happens with extern(C) :
> 
> Yes, that does seem to be the trend, and I don't like it.  `static` methods at the module level is another; the `static` is pointless, but the compiler doesn't seem to mind.
> 
> I would prefer that, if a token is meaningless, the compiler emit an error.

I think that an error is too much, but a warning could be appreciated. On the other hand, I know that Walter is against warnings so I don't know if this is going to advance in any way.

--
April 19, 2018
https://issues.dlang.org/show_bug.cgi?id=13184

--- Comment #4 from Manu <turkeyman@gmail.com> ---
I think it should definitely emit an error.
There may come some time in the future where it is decided that application of
the attribute may like to mean something new and useful, but if we leave this
situation as is, then that is a breaking change.
If we expect that meaningless attributes produce compile errors, then in the
future when we want to make it meaningful, we can do it without breaking any
code.

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=13184

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P4

--
December 13
https://issues.dlang.org/show_bug.cgi?id=13184

--- Comment #5 from dlangBugzillaToGithub <robert.schadek@posteo.de> ---
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/17670

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB

--