no codegen for parts of failed template instantiations#3074
no codegen for parts of failed template instantiations#30749rnsr merged 1 commit intodlang:masterfrom
Conversation
src/dsymbol.c
Outdated
There was a problem hiding this comment.
Usual style in dmd is if (
|
Just use a loop in |
To avoid finding a good name? ;-) The PR #2480 calls it from other places aswell (e.g. when TypeInfo for erronuous types has been generated), so a function would be nice. |
|
The problem is that we shouldn't be getting here in the first place - at this point all instances with errors are speculative and shouldn't be outputted anyway. Maybe we should keep a list of all child template instances and recursively mark them as non-speculative? |
|
Following Kenjis' suggestion, I moved the parent check to isError. |
There was a problem hiding this comment.
s is already != NULL, so s && is redundant.
There was a problem hiding this comment.
Hmmm, I'd rather say the test is missing in the check for s->errors. If we can assume isErrors is always a Dsymbol, we should pass it as that.
There was a problem hiding this comment.
BTW: is there any reason why code isn't written as "if (Dsymbol* s = isDsymbol(o)) {}"? I'm very much tempted to change it to this style if I stumble over it.
There was a problem hiding this comment.
o is neither Type, Expression, nor Tuple. so it is always Dsymbol.
There was a problem hiding this comment.
Additionally, s->errors at line 105 already assumes that s != NULL. Therefore, testing it here looks weird to me.
|
Anyway, this change does not have serious problem, and I also confirmed that the it would fix the issue in #1411 in my local. |
no codegen for parts of failed template instantiations
|
Thanks. The win64 tests now pass. |
do not write failed template instantiations or parts of these to the object file.
This solves the duplicate COMDAT error in dlang/phobos#1411