Skip to content

Conversation

DougGregor
Copy link
Member

When a (non-generic) typealias refers to a specialization of a generic
type, e.g.

  typealias simd_float3 = SIMD3<Float>

treat an extension of the typealias as an extension of the underlying
type with same-type constraints between the generic parameters and the
specific arguments, e.g.,

  extension simd_float3 { }

is treated as

  extension SIMD3 where Scalar == Float { }

This addresses a source-compatibility problem with SE-0229, where
existing types such as simd3_float (which were separate structs)
became specializations of a generic SIMD type.

Fixes rdar://problem/46604664 and rdar://problem/46604370.

…izations.

When a (non-generic) typealias refers to a specialization of a generic
type, e.g.

```swift
  typealias simd_float3 = SIMD3<Float>
```

treat an extension of the typealias as an extension of the underlying
type with same-type constraints between the generic parameters and the
specific arguments, e.g.,

```swift
  extension simd_float3 { }
```

is treated as

```swift
  extension SIMD3 where Scalar == Float { }
```

This addresses a source-compatibility problem with SE-0229, where
existing types such as simd3_float (which were separate structs)
became specializations of a generic SIMD type.

Fixes rdar://problem/46604664 and rdar://problem/46604370.

(cherry picked from commit b88a875)
@DougGregor DougGregor requested a review from a team as a code owner December 14, 2018 23:09
@DougGregor
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 691905e

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 691905e

@DougGregor
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 691905e

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 691905e

@DougGregor DougGregor merged commit 12e873d into swiftlang:swift-5.0-branch Dec 15, 2018
@DougGregor DougGregor deleted the ext-typealias-of-specialized-5.0 branch December 15, 2018 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants