Skip to content

Commit a272807

Browse files
committed
Add paragraph for non-overloadable this(this)
1 parent 19bdc68 commit a272807

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

spec/struct.dd

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,19 @@ void main()
660660
---
661661
)
662662

663+
$(P Postblits are not overloadable. If 2 postblits are defined,
664+
even if the signatures differ, the compiler will assign the
665+
`__postblit` name to both and later issue a conflicting function
666+
name error:)
667+
668+
---
669+
struct X
670+
{
671+
this(this) {}
672+
this(this) const {} // error: function X.__postblit conflicts with function X.__postblit
673+
}
674+
---
675+
663676
$(P Unions may not have fields that have postblits.)
664677

665678
$(H2 $(LEGACY_LNAME2 StructDestructor, struct-destructor, Struct Destructors))

0 commit comments

Comments
 (0)