Bug or "hidden" feature?

Temtaime temtaime at gmail.com
Mon Nov 6 09:48:39 UTC 2017


On Monday, 6 November 2017 at 09:44:24 UTC, bauss wrote:
> If a function has an UDA you don't need to give the function a 
> return type.
>
> Is that a bug or a hidden feature?
>
> Example:
>
> ```
> import std.stdio;
>
> struct A { }
>
> @A test()
> {
> 	writeln("Called test()");
> }
>
> @A test2()
> {
> 	return true;
> }
>
> void main()
> {
> 	test();
> 	writeln(test2());
> }
> ```

Feature as return type is not necessary and considered auto when 
some qualifiers are added

const foo() {}

@property foo() {}

etc


More information about the Digitalmars-d mailing list