Bug 276 – Compiler erroneously thinks an aggregate inner template will add a field to it
Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-08-02T17:22:47Z
Last change time
2021-05-28T01:34:22Z
Keywords
rejects-valid
Assigned to
Walter Bright
Creator
Bruno Medeiros
Comments
Comment #0 by bruno.do.medeiros+deebugz — 2006-08-02T17:22:47Z
Compiler erroneously thinks an aggregate inner template will add a field to it:
---
import BUGMultiDisFunction;
struct st {
template t1() {
template t2(int n2) { }
}
}
alias st.t1!().t2 a;
---
Error:
" variable main.st.t1!().n2 cannot use template to add field to aggregate 'st' "
This only happens because of the "int n2" parameter. If the parameter is a type, alias, or non-existent, there will be no compiler error.
dlang/dlang-bot pull request #277 "Escape backticks with backslashes" was merged into master:
- 32e43a05f291699eb28d96f2b136bc975b78651f by Vladimir Panteleev:
Escape backticks with backslashes
Fixes #276.
https://github.com/dlang/dlang-bot/pull/277