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
42 changes: 39 additions & 3 deletions deprecate.dd
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ $(SPEC_S Deprecated Features,

$(TABLE2 Deprecated Features,
$(THEAD Feature, Spec, Dep, Error, Gone)
$(TROW $(DEPLINK Implicit comparison of different enums), 2.075, 2.075,  ,  )
$(TROW $(DEPLINK Implicit string concatenation), 2.072, 2.072,  ,  )
$(TROW $(DEPLINK Using the result of a comma expression), 2.072, 2.072,  ,  )
$(TROW $(DEPLINK delete), future,  ,  ,  )
Expand Down Expand Up @@ -57,16 +58,51 @@ $(SPEC_S Deprecated Features,
$(DD The feature is completely gone)
)

$(H3 $(DEPNAME Implicit comparison of different enums))
$(P Comparison of different enumerated type was allowed:
---
enum Status
{
good,
bad
}
enum OtherStatus
{
ok
no,
}
static assert(Status.good == OtherStatus.ok);
---
)
$(H4 Corrective Action)
$(P Comparison between unrelated enumerated types should be done with $(REF asOriginalType, std, conv))
---
import std.conv : asOriginalType;
assert(Foo.x.asOriginalType == Bar.y.asOriginalType);
---
$(H4 Rationale)
$(P Code correctness is improved by
disallowing comparison of unrelated enumerated types. Implicit comparison of
different `enum` types often resulted in hard to spot bugs.)

---
enum { X }
enum { Y }
void main() {
auto b = X == Y;
assert(b);
}
---

$(H3 $(DEPNAME Implicit string concatenation))
$(P Currently, two adjacent strings are implicitly concatenated:
$(P Two adjacent strings were implicitly concatenated:

---
string foo = "Hello" "World";
---

This feature is handy for a long string that spans multiple lines,
however it is possible to get the same behaviour explicitly by
This feature was handy for a long string that spans multiple lines,
however, it is possible to get the same behaviour explicitly by
using the concatenation operator ('~'):

---
Expand Down