# Disambiguating property wrappers with package name

**URL:** <https://forums.swift.org/t/disambiguating-property-wrappers-with-package-name/69382>\
**Category:** Using Swift\
**Tags:** propertywrapper, namespaces\
**Created:** [January 11, 2024, 1:00am UTC](https://forums.swift.org/t/disambiguating-property-wrappers-with-package-name/69382 "2024-01-11T01:00:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![commscheck](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/commscheck/32/10075_2.png) [@commscheck](https://forums.swift.org/u/commscheck)\
**Post date:** [January 11, 2024, 1:00am UTC](https://forums.swift.org/t/disambiguating-property-wrappers-with-package-name/69382/1 "2024-01-11T01:00:07Z")

</div>

When we import two packages that each have a member with the same name, we can disambiguate by prepending the package name:

```swift
// CoolShapes package:
public struct Circle {
  public var radius: Double
}

// CoolMath package:
public struct Circle {
  public var diameter: Double
}

// App target:
import CoolShapes
import CoolMath

// Error: 'Circle' is ambiguous for type lookup in this context
var circle1: Circle?

// Both fine:
var circle2: CoolMath.Circle?
var circle3: CoolShapes.Circle?

```

Is it possible to do the same with property wrappers? I can't find a format e.g. `@<package>.<type>` that doesn't result in a compiler error.

This came about when migrating a project from [Resolver](https://github.com/hmlongco/Resolver) to [Factory](https://github.com/hmlongco/Factory?tab=readme-ov-file), since they both provide the `@Injected` wrapper. Using e.g. `@Factory.Injected` gives an error `'Injected' is not a member type of generic struct 'Factory.Factory'`.

Cheers!

---

<div class="post-metadata">

**Author:** ![Dmitriy\_Ignatyev](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/dmitriy_ignatyev/32/11340_2.png) [@Dmitriy\_Ignatyev](https://forums.swift.org/u/Dmitriy_Ignatyev)\
**Post date:** [January 11, 2024, 12:25pm UTC](https://forums.swift.org/t/disambiguating-property-wrappers-with-package-name/69382/2 "2024-01-11T12:25:02Z")

</div>

Have you tried to make a type alias?

```swift
typealias FactoryInjected<T> = Factory.Injected<T>
typealias ResolverInjected<T> = Resolver.Injected<T>

@FactoryInjected var: dependency

```
