[swift-dev] Help: Get Generic Pattern Detail From TypeDecl in AST

Jacob Bandes-Storch jtbandes at gmail.com
Mon Jan 11 16:34:54 CST 2016


You might find BoundGenericType useful:

https://github.com/apple/swift/blob/5aa40dd0aa057591398339c77df91a976ae35c72/include/swift/AST/Types.h#L1438

Jacob Bandes-Storch

On Mon, Jan 11, 2016 at 2:31 PM, Daniel Duan via swift-dev <
swift-dev at swift.org> wrote:

> Hi all,
>
> Working on a swiftc crash in the type checker, I’m having a hard time with
> getting generic type pattern in the AST. For example, say we have parsed:
>
> struct Y<T> {}
> struct X<T, U> {
>   let a: Y<T>
>   let b: Y<U>
> }
>
>
> In the AST, the type of member “a” would be  “Y<T>". But I can’t figure
> out how to inspect the inner “T” from the TypeDecl instance that represents
> a’s type.
>
> What am I missing here?
>
> - Daniel
> _______________________________________________
> 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/20160111/e42363a2/attachment.html>


More information about the swift-dev mailing list