Skip to content

Conversation

@hborla
Copy link
Member

@hborla hborla commented Feb 20, 2020

The rules for @_typeEraser are:

  1. The type eraser must be a concrete nominal type
  2. The type eraser must not have more restrictive access than the annotated protocol
  3. The type eraser must conform to the annotated protocol
  4. The type eraser must have an initializer of the form init<T: AnnotatedProtocol>(erasing: T)
    • Other generic requirements are okay as long as the init can always be called with a value of any type conforming to the protocol
    • The init cannot have more restrictive access than the annotated protocol

@hborla hborla requested a review from xedin February 20, 2020 19:54
@hborla
Copy link
Member Author

hborla commented Feb 20, 2020

@swift-ci please smoke test

…r in

the case where the type eraser has no viable initializers.
@hborla hborla force-pushed the type-check-type-eraser-attribute branch from 5864c51 to 2185f43 Compare February 20, 2020 20:51
@hborla
Copy link
Member Author

hborla commented Feb 20, 2020

@swift-ci please smoke test

Copy link
Contributor

@xedin xedin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

and replacing type parameters in a generic signature when type checking
the typeEraser attribute.
@hborla
Copy link
Member Author

hborla commented Feb 21, 2020

@swift-ci please smoke test

@hborla hborla merged commit 9f09add into swiftlang:master Feb 21, 2020
@hborla hborla deleted the type-check-type-eraser-attribute branch February 21, 2020 22:13
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.

4 participants