DIP86

From D Wiki
Revision as of 02:28, 14 January 2016 by Hackerpilot (talk | contribs) (Created page with "{| class="wikitable" !Title: !'''DIP Template''' |- |DIP: |86 |- |Version: |1 |- |Status: |Draft |- |Created: |2016-01-13 |- |Last Modified: |{{REVISIONYEAR}}-{{REVISIONMONTH}...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Title: DIP Template
DIP: 86
Version: 1
Status: Draft
Created: 2016-01-13
Last Modified: 2016-01-14
Author: Brian Schott
Links:

Abstract

Currently the version of "deprecated" that takes a string literal describing the deprecation can be used as an attribute, but not a storage class. The version that does not take a description can be used as both. This DIP will make the use of the "deprecated" attribute/storage class more consistent.

Rationale

It is confusing to the users of D that the following code compiles:

deprecated i = 10;

but the following code does not:

deprecated("This field will be removed in March 2017") i = 10;

Grammar Change

"deprecated" will be removed from the "StorageClass" grammar and replaced with "DeprecatedAttribute".

Backwards Compatability

Because this change will allow previously invalid code to be valid, no old code will need to be upgraded.

Copyright

This document has been placed in the Public Domain.