Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions spec/function.dd
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,31 @@ void main()
}
------

$(P It's not allowed to mark an overridden method with the attributes
$(LINK2 attribute.html#disable, $(D @disable)) or
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use a macro for such links, e.g RELATIVE_LINK2 would work ;-)

$(LINK2 attribute.html#deprecated, $(D deprecated)).
To stop the compilation or to output the deprecation message, the compiler
must be able to determine the target of the call, which can't be guaranteed
when it is virtual.
)

------
class B
{
void foo() {}
}

class D : B
{
@disable override void foo() {}
}

void main()
{
B b = new D;
b.foo(); // would compiles and then the most derived would be called even if disabled.
}
------

$(H4 $(LNAME2 inline-functions, Inline Functions))

Expand Down