# Why does \`import typealias\` work on types?

**URL:** <https://forums.swift.org/t/why-does-import-typealias-work-on-types/62474>\
**Category:** Using Swift\
**Tags:** import\
**Created:** [January 9, 2023, 9:32pm UTC](https://forums.swift.org/t/why-does-import-typealias-work-on-types/62474 "2023-01-09T21:32:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon9791410](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@anon9791410](https://forums.swift.org/u/anon9791410)\
**Post date:** [January 9, 2023, 9:32pm UTC](https://forums.swift.org/t/why-does-import-typealias-work-on-types/62474/1 "2023-01-09T21:32:42Z")

</div>

It works with actual type aliases:

```swift
import typealias Swift.Void

```

But also, types. Either spelling seems to work the same.

```swift
import typealias Foundation.Data
import struct Foundation.Data

```

Is this a bug, a result of preparing for some future feature, or something useful I don't know about yet?

---

<div class="post-metadata">

**Author:** ![jrose](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/jrose/32/408_2.png) [@jrose](https://forums.swift.org/u/jrose)\
**Post date:** [January 9, 2023, 10:00pm UTC](https://forums.swift.org/t/why-does-import-typealias-work-on-types/62474/2 "2023-01-09T22:00:48Z")

</div>

Convenience, really. You might not know or care if a particular type is implemented as a struct, class, or enum, depending on its API. (And once upon a time, we wondered whether converting a struct to an enum should be considered an ABI-compatible change, not just API-compatible, but decided not to bother ensuring that.)
