D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 23311 - Allow creating alias for __gshared
Summary: Allow creating alias for __gshared
Status: RESOLVED WONTFIX
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-29 13:36 UTC by ryuukk_
Modified: 2022-09-01 13:17 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description ryuukk_ 2022-08-29 13:36:05 UTC
The following code doesn't compile

```
alias notls = __gshared;
```

onlineapp.d(2): Error: basic type expected, not `;`
onlineapp.d(2): Deprecation: storage class `__gshared` has no effect in type aliases


__gshared is annoying to type, and doesn't convey the proper intention

Being able to alias it would solve my problem


`shared` is not a solution
Comment 1 RazvanN 2022-09-01 13:17:30 UTC
I'm sorry, but this bug report is invalid. By the current spec, aliases can only be made to types or symbols, whereas __gshared is a type qualifier just like const, immutable etc. You cannot do `alias im = immutable`. `__gshared` is ugly and hard to type on purpose, because it is unsafe and requires that the programmer really understands what he/she is doing.

I will close this as WONTFIX.