[swift-dev] metatype of Int

Dave Abrahams dabrahams at apple.com
Fri Dec 18 14:10:23 CST 2015


> On Dec 18, 2015, at 11:16 AM, Rafkind, Jon via swift-dev <swift-dev at swift.org> wrote:
> 
> Given a swift::MetaType how can I tell if it corresponds to the MetaType of the standard Int type? Is there a way to get a reference to the MetaType from the StdlibModule or TheBuiltinModule?
> 
> For now I can convert the MetaType to a string and compare it to "Int.Type" but that is yucky.

Equality comparison works:

(swift) String.self == Int.self
// r2 : Bool = false
(swift) Int.self == Int.self
// r3 : Bool = true


> 
> --
> _______________________________________________
> swift-dev mailing list
> swift-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-dev

-Dave





More information about the swift-dev mailing list