D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 18479 - does not match template declaration: syntax highlight error and enum not symbolized
Summary: does not match template declaration: syntax highlight error and enum not symb...
Status: RESOLVED DUPLICATE of issue 8044
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Mac OS X
: P1 minor
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-20 21:55 UTC by Timothee Cour
Modified: 2020-10-10 00:12 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Timothee Cour 2018-02-20 21:55:37 UTC
/Users/timothee/git_clone/D/dcv/source/dcv/core/utils.d(65,13): Error: template instance `Slice!(cast(SliceKind)2, [1], IotaIterator)` does not match template declaration Slice(SliceKind kind, ulong[] packs, Iterator) if (packs.sum < 255 && !(kind == Canonical && (packs == [1])))

2 annoyances:

* `Slice!(cast(SliceKind)2, [1], IotaIterator)` is not syntax highlighted somehow (unlike `Slice(SliceKind kind, ulong[] packs, Iterator) if (packs.sum < 255 && !(kind == Canonical && (packs == [1])))` which gets highlighted)

* cast(SliceKind)2 should be converted to its symbolic representation (as is case for Canonical in kind == Canonical)
Comment 1 Timothee Cour 2018-02-20 22:05:54 UTC
NOTE:
for context here's the enum:
```
enum SliceKind
{
    /// A slice has strides for all dimensions.
    universal,
    /// A slice has >=2 dimensions and row dimension is contiguous.
    canonical,
    /// A slice is a flat contiguous data without strides.
    contiguous,
}
```

I'd expect to see:
s/cast(SliceKind)2/contiguous or even better, SliceKind.contiguous
Comment 2 Mathias LANG 2020-10-10 00:12:16 UTC
The syntax highlight thing is fixed, and the enum thing is a duplicate of 8044 for which I just opened a PR.

*** This issue has been marked as a duplicate of issue 8044 ***