Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

[SoM] escaping attribute may only be used in function parameter position #122

Open
chamons opened this issue Aug 10, 2018 · 2 comments
Open
Milestone

Comments

@chamons
Copy link
Contributor

chamons commented Aug 10, 2018

This originally used NSImage instead of NSObject but it fails just the same

import AppKit

public extension Array where Element : NSObject {

  public func gradient(_ transform: ((_ gradient: inout CAGradientLayer) -> CAGradientLayer)? = nil) -> CAGradientLayer {
    var gradient = CAGradientLayer()
    return gradient
  }
}

Error (Fatal): SwiftRepro-Array-Extension0.swift:7:40: error: @escaping attribute may only be used in function parameter position
    transform: UnsafePointer<Optional<@escaping (_: UnsafeMutablePointer<CAGradientLayer>, 
                                      ~^~~~~~~~~
                                      
SwiftRepro-Array-Extension0.swift:7:40: error: @escaping attribute may only be used in function parameter position
    transform: UnsafePointer<Optional<@escaping (_: UnsafeMutablePointer<CAGradientLayer>, 
                                      ~^~~~~~~~~
                                      
SwiftRepro-Array-Extension0.swift:7:40: error: @escaping attribute may only be used in function parameter position
    transform: UnsafePointer<Optional<@escaping (_: UnsafeMutablePointer<CAGradientLayer>, 
                                      ~^~~~~~~~~
                                      
SwiftRepro-Array-Extension0.swift:11:17: error: 'T0' is not a subtype of 'NSObject'
    return this.gradient(transform.pointee);
           ~~~~~^~~~~~~~
 (Exception)

@chamons
Copy link
Contributor Author

chamons commented Aug 10, 2018

Possible duplicate \ simplification of bits of https://github.com/xamarin/maccore/issues/692 ?

@chamons
Copy link
Contributor Author

chamons commented Aug 10, 2018

Hue.framework

@stephen-hawley stephen-hawley transferred this issue from another repository Oct 29, 2019
@chamons chamons added this to the Future milestone Nov 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant