Skip to content

Conversation

theblixguy
Copy link
Collaborator

@theblixguy theblixguy commented Jan 20, 2019

This PR adds the ability for the @autoclosure closure to be a type alias.

Example:

class Foo {
  typealias FooClosure = () -> String
  func fooFunction(closure: @autoclosure FooClosure) {} // ok
}

Resolves SR-2688.

@theblixguy
Copy link
Collaborator Author

cc @jrose-apple

@CodaFi
Copy link
Contributor

CodaFi commented Jan 21, 2019

Looks good. Just one small request.

@xedin
Copy link
Contributor

xedin commented Jan 21, 2019

@swift-ci please smoke test and merge

@theblixguy
Copy link
Collaborator Author

theblixguy commented Jan 21, 2019

@xedin can you invoke the CI again? had to fix a crash related to passing null to dyn_cast.

@xedin
Copy link
Contributor

xedin commented Jan 21, 2019

@swift-ci please smoke test

@theblixguy
Copy link
Collaborator Author

Still crashing 🤔 Assertion failed: (Val && "isa<> used on a null pointer")

import Metal
class Bar {
  func barFunction(closure: @escaping MTLDeviceNotificationHandler) {}
}

Let me investigate why this is happening, it seems to be crashing when type checking @escaping

@theblixguy
Copy link
Collaborator Author

All good now, I have ran a validation test locally to ensure everything's ok. @xedin can you invoke the CI one more time? thank you!

@xedin
Copy link
Contributor

xedin commented Jan 22, 2019

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 7e12ae56edda5893f2ef4b927f20229be291c340

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 7e12ae56edda5893f2ef4b927f20229be291c340

@xedin xedin merged commit 8944665 into swiftlang:master Jan 22, 2019
@theblixguy theblixguy deleted the fix/SR-2688 branch January 22, 2019 20:52
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