Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-1828] CGContext.endPage() is ambiguous #44437

Closed
swift-ci opened this issue Jun 20, 2016 · 4 comments
Closed

[SR-1828] CGContext.endPage() is ambiguous #44437

swift-ci opened this issue Jun 20, 2016 · 4 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself regression SDKOverlay swift 3.0

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-1828
Radar rdar://problem/26746287
Original Reporter stemichels (JIRA User)
Type Bug
Status Closed
Resolution Done

Attachment: Download

Environment

Apple Swift version 3.0 (swiftlang-800.0.30 clang-800.0.24)
Target: x86_64-apple-macosx10.9

Additional Detail from JIRA
Votes 1
Component/s Compiler
Labels Bug, 3.0Regression, SDKOverlay
Assignee @milseman
Priority Medium

md5: 0d04ab0f2430c8f7c490b66978f1e9b0

Issue Description:

It seems that new naming scheme of Swift 3 produce a conflict with endPage() method of CGContext.

let data = NSMutableData()
    guard let consumer = CGDataConsumer(data: data) else {
        fatalError()
    }
    
    var rect = CGRect(x: 0, y: 0, width: 100, height: 100)
    guard let context = CGContext(consumer: consumer, mediaBox: &rect, nil) else {
        fatalError()
    }
    
    context.beginPage(nil)
    
    context.setStrokeColor(CGColor.constantColor(for: CGColor.black)!)
    context.strokeEllipse(in: rect)
    
    context.endPage()
    context.closePDF()
Generated output of the compiler:
EndPageProblem.swift:20:5: error: ambiguous use of 'endPage()'
    context.endPage()
    ^
CoreGraphics.CGContext:196:17: note: found this candidate
    public func endPage()
                ^
CoreGraphics.CGContext:11:17: note: found this candidate
    public func endPage()
                ^

With this I am unable to generated PDFs with CoreGraphics.

@belkadan
Copy link
Contributor

@milseman, you have a dup or Radar for this already, correct?

@milseman
Copy link
Mannequin

milseman mannequin commented Jun 20, 2016

Yes, <rdar://problem/26746287>

@swift-ci
Copy link
Collaborator Author

Comment by Harry Thompson (JIRA)

Will this get included in the next version of Xcode 8 beta or is this scheduled for a later release?

@belkadan
Copy link
Contributor

I can't speak to Xcode releases, but the commit is in the preview 2 branch. #3139

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself regression SDKOverlay swift 3.0
Projects
None yet
Development

No branches or pull requests

3 participants