Skip to content

SE-0080 (4/4) - Failable initializers for Float->Int #4314

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

Merged
merged 2 commits into from
Jan 13, 2017

Conversation

ultramiraculous
Copy link
Contributor

What's in this pull request?

Breaking out from #2742. Adds init?(exactly:) initializers for float types from int types.

Resolved bug number: (SR-1491)


Before merging this pull request to apple/swift repository:

  • Test pull request on Swift continuous integration.

Triggering Swift CI

The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:

Smoke Testing

Platform Comment
All supported platforms @swift-ci Please smoke test
All supported platforms @swift-ci Please smoke test and merge
OS X platform @swift-ci Please smoke test OS X platform
Linux platform @swift-ci Please smoke test Linux platform

A smoke test on macOS does the following:

  1. Builds the compiler incrementally.
  2. Builds the standard library only for macOS. Simulator standard libraries and
    device standard libraries are not built.
  3. lldb is not built.
  4. The test and validation-test targets are run only for macOS. The optimized
    version of these tests are not run.

A smoke test on Linux does the following:

  1. Builds the compiler incrementally.
  2. Builds the standard library incrementally.
  3. lldb is built incrementally.
  4. The swift test and validation-test targets are run. The optimized version of these
    tests are not run.
  5. lldb is tested.

Validation Testing

Platform Comment
All supported platforms @swift-ci Please test
All supported platforms @swift-ci Please test and merge
OS X platform @swift-ci Please test OS X platform
OS X platform @swift-ci Please benchmark
Linux platform @swift-ci Please test Linux platform

Lint Testing

Language Comment
Python @swift-ci Please Python lint

Note: Only members of the Apple organization can trigger swift-ci.

@ultramiraculous ultramiraculous force-pushed the failable-int-to-float branch 2 times, most recently from e92d3e0 to be0e926 Compare August 16, 2016 05:48
@ultramiraculous
Copy link
Contributor Author

(Really late in the game here, I know)

@ultramiraculous ultramiraculous changed the title SE-0080 (4/5) - Failable initializers for Float->Int SE-0080 (4/4) - Failable initializers for Float->Int Aug 17, 2016
@CodaFi
Copy link
Contributor

CodaFi commented Aug 18, 2016

Let's get a test run at least.

@swift-ci please smoke test.

@CodaFi
Copy link
Contributor

CodaFi commented Aug 18, 2016

// @shahmishal

@CodaFi
Copy link
Contributor

CodaFi commented Aug 18, 2016

@swift-ci please test.

% end

% if srcBits < SignificandBitCount:
@available(*, message: "Converting ${That} to ${Self} will always succeed.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a test for this warning somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No... I hadn't thought to test these/I'm not sure I know how.

Copy link
Contributor

@CodaFi CodaFi Jan 5, 2017

Choose a reason for hiding this comment

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

You can use GYB to write tests and the usual filecheck mechanism to check the warning.

@jtbandes
Copy link
Contributor

@ultramiraculous Any update on this? Looks like some conflicts have been introduced at this point. I'd be up for helping to resolve them if you like.

@ultramiraculous
Copy link
Contributor Author

@jtbandes hey yeah sorry I at least completely dropped the ball on following up on this. Things got busy on my end. I can at least resolve the conflicts sometime today probably.

@ultramiraculous
Copy link
Contributor Author

@gribozavr / @jtbandes Can this at least get the test suite run against it?

@CodaFi
Copy link
Contributor

CodaFi commented Dec 12, 2016

@swift-ci please smoke test.

@ultramiraculous
Copy link
Contributor Author

Ping @CodaFi

@CodaFi
Copy link
Contributor

CodaFi commented Jan 5, 2017

Okay, I can take responsibility for seeing this through. I left a comment about testing the warning. Because this addresses Dmitri's comments, it should be GTG after that.

@slavapestov slavapestov self-assigned this Jan 11, 2017
@slavapestov
Copy link
Contributor

@CodaFi Can we merge this?

@CodaFi
Copy link
Contributor

CodaFi commented Jan 11, 2017

This requires @ultramiraculous' attention still.

@CodaFi
Copy link
Contributor

CodaFi commented Jan 13, 2017

@ultramiraculous I'm going to rebase onto this and add the test myself.

@CodaFi
Copy link
Contributor

CodaFi commented Jan 13, 2017

@slavapestov Does this need to be PR'd over to 3.1 too?

@ultramiraculous
Copy link
Contributor Author

Yeah sorry about that and thanks. I keep trying to find time to focus on this.

@CodaFi
Copy link
Contributor

CodaFi commented Jan 13, 2017

Well, on second thought I don't think the changes I want are enough to block this merge.

⛵️

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