[swift-dev] Problems caused by "is<ErrorType>"

Slava Pestov spestov at apple.com
Mon Dec 7 12:44:39 CST 2015

Hi Jacob,

Maybe it would be better to figure out why getMemberSubstitutions() is being called on the invalid type, and try to catch the problem further up?

Otherwise, Doug Gregor might have further suggestions.


> On Dec 5, 2015, at 11:41 PM, Jacob Bandes-Storch via swift-dev <swift-dev at swift.org> wrote:
> 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
>  _______________________________________________
> swift-dev mailing list
> swift-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20151207/2531511f/attachment.html>

More information about the swift-dev mailing list