[swift-dev] Problems caused by "is<ErrorType>"
Jacob Bandes-Storch
jtbandes at gmail.com
Sun Dec 6 01:41:01 CST 2015
Investigating compiler_crashers/26960-void.swift, I found that
TypeBase::getMemberSubstitutions is being called on a NominalType
(StructType) whose Parent is an ErrorType (getString() returns "<<error
type>>.B").
In this case, is<ErrorType>() returns false, because the type is not itself
an ErrorType, only its parent is.
Immediately collapsing any NominalType whose parent is ErrorType seems like
it would lose information that might be useful for diagnostics. However,
simply checking is<ErrorType>() is clearly insufficient.
Should there be something like "isErrorType()" which checks recursively
whether any members (including Parent) are ErrorType?
Jacob Bandes-Storch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20151205/f0247587/attachment.html>
More information about the swift-dev
mailing list