Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@shallow for data and constructor declarations #38

Closed
2 tasks
fmease opened this issue Nov 7, 2020 · 1 comment
Closed
2 tasks

@shallow for data and constructor declarations #38

fmease opened this issue Nov 7, 2020 · 1 comment
Labels
A-name-resolution Area: Name resolution T-proposal Type: Proposed feature which might not actually be accepted

Comments

@fmease
Copy link
Owner

fmease commented Nov 7, 2020

The attribute @shallow switches from the default mode of creating a namespace containing subordinate declarations to placing those into the same namespace where the original declaration is defined in.

It is semver compatible (here i.e. not a major change) for an API to go from a non-shallow data declaration to a shallow one if all constructors are (manually) used in the same module and the same exposure scope of the data type. Starting out with non-shallow is thus forward compatible. The reverse is not given. Neither direction is given for (non-)shallowness on constructors since one cannot use inside of the constructor listing.

Motivation

Less to type esp. when prototyping since one does not need to qualify paths as much or need to use them. No other reason. Therefore, it is quite low priority and might not even become part of the language at all.

Scope

  • on data declarations
  • on constructor declarations
@fmease fmease added A-name-resolution Area: Name resolution enhancement labels Nov 10, 2020
@fmease fmease added the design Open design questions that need to be solved label Nov 21, 2020
@fmease fmease changed the title Implement @shallow for data declarations @shallow for data and constructor declarations Dec 12, 2020
@fmease fmease added T-proposal Type: Proposed feature which might not actually be accepted and removed design Open design questions that need to be solved labels Dec 12, 2020
@fmease
Copy link
Owner Author

fmease commented Dec 12, 2020

Resolution: Not worth adding. Creates "two ways of doing things" and makes the name resolver a tiny bit more complex for such an edge case feature. Alternative: "use all" (in turn not part of the language but a proposal) (e.g. use Data._) which is only allowed in protoyping mode (if ever added).

@fmease fmease closed this as completed Dec 12, 2020
@fmease fmease mentioned this issue Dec 12, 2020
15 tasks
@fmease fmease closed this as not planned Won't fix, can't repro, duplicate, stale Aug 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-name-resolution Area: Name resolution T-proposal Type: Proposed feature which might not actually be accepted
Projects
None yet
Development

No branches or pull requests

1 participant