dlang / ddox

Advanced D documentation engine
MIT License
63 stars 21 forks source link

Add downcast result check (#151) #153

Closed MaksimZh closed 7 years ago

MaksimZh commented 7 years ago

This fix will prevent crash on types inherited from templates (issue #151). Note that the resulting documentation will be incomplete because those templates are skipped.

MartinNowak commented 7 years ago

You know where in the html output this is used? I'd image we want templated derived classes to appear there as well.

Here is existing code that peals off eponymous templates, not sure if that makes sense here. https://github.com/rejectedsoftware/ddox/blob/94ec70a8e5c7e7d31a0ec0f8d9d37fece266008b/source/ddox/parsers/dparse.d#L417-L424

MaksimZh commented 7 years ago

I'd suggest fix the crash issue first and then create another one for incomplete documentation. In its current state DDOX is unable to generate any documentation for every project that has at least one type inherited from template.

MartinNowak commented 7 years ago

Thanks for your work and sorry for not getting back earlier.

You arguments makes some sense, but I'd still prefer to not simply workaround the immediate issue while introducing new bugs. Also you just fixed interfaces, but left base class templates broken (2 lines above). Those sort of if (exp !is null) fixes tend to accumulate as cargo cult and maintenance debt, better not to start with that. It's clearly tricky for someone not too familiar with the codebase to provide a proper fix, I'll have a look.

Closed in favor of #167