D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20696 - Should error when retrieving mangling while the type is not yet final
Summary: Should error when retrieving mangling while the type is not yet final
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2020-03-24 08:51 UTC by Walter Bright
Modified: 2020-03-28 14:22 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 Walter Bright 2020-03-24 08:51:50 UTC
Consider:

-----
struct S() {
  int test() {
    pragma(msg, test.mangleof);
    return 3;
  }
}

S!() s;
-----

This should give an error, because attributes that affect mangling are not known until the semantic analysis is complete.
Comment 1 Dlang Bot 2020-03-24 08:56:42 UTC
@WalterBright created dlang/dmd pull request #10961 "Fix Issue 20696 - Should error when retrieving mangling while the typ…" fixing this issue:

- Fix Issue 20696 - Should error when retrieving mangling while the type is not yet final

https://github.com/dlang/dmd/pull/10961
Comment 2 Mathias LANG 2020-03-24 10:19:31 UTC
Looks like a duplicate of https://issues.dlang.org/show_bug.cgi?id=15431
Comment 3 Walter Bright 2020-03-24 19:03:07 UTC
15431 is related, but a different problem requiring a different solution.
Comment 4 Dlang Bot 2020-03-28 14:22:58 UTC
dlang/dmd pull request #10961 "Fix Issue 20696 - Should error when retrieving mangling while the typ…" was merged into master:

- c4e6520f862b80dbb3756c05c29a4fcd25aa7d5d by Walter Bright:
  Fix Issue 20696 - Should error when retrieving mangling while the type is not yet final

https://github.com/dlang/dmd/pull/10961