Bug 15501 – Missing parens for template argument in error message: Error: no property 'nsecs' for type 'MonoTimeImpl!cast(ClockType)0'

Status
RESOLVED
Resolution
WORKSFORME
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-01-03T02:27:09Z
Last change time
2022-10-28T09:07:53Z
Keywords
trivial
Assigned to
No Owner
Creator
Timothee Cour

Comments

Comment #0 by timothee.cour2 — 2016-01-03T02:27:09Z
dmd -c -o- main.d: Error: no property 'nsecs' for type 'MonoTimeImpl!cast(ClockType)0' the type in the error message is invalid, it should be: 'MonoTimeImpl!(cast(ClockType)0)' --- void test() { static import core.time; auto temp=core.time.MonoTime.currTime.nsecs * 1e-9; } ---
Comment #1 by timothee.cour2 — 2016-01-03T02:29:53Z
in dmd 67, the error message was correctly typed: Error: no property 'nsecs' for type 'MonoTime' although the root cause is probably that error message wrongly removes parenthesis when the template argument is cast!(...)foo
Comment #2 by issues.dlang — 2016-01-04T11:17:20Z
Previously, it printed MonoTime instead of MonoTimeImpl!cast(ClockType)0, because MonoTime wasn't previously templated, whereas is now it's an alias to MonoTimeImpl!(ClockType.normal). The bug here is entirely in how dmd prints out the template argument in the error message.
Comment #3 by razvan.nitu1305 — 2022-10-28T09:07:53Z
This now yields: test.d(3): Error: no property `nsecs` for `currTime()` of type `core.time.MonoTimeImpl!ClockType.normal` Which is the correct error message.