Skip to content
This repository has been archived by the owner on Sep 19, 2018. It is now read-only.

Reintroduce subscripting ifNull/ifNotFound methods (with deprecation warnings) #149

Merged

Conversation

jgallagher
Copy link
Contributor

This PR reintroduces the ... ifNotFound: ... and ... ifNull: ... subscripting methods to keep backwards compatibility. They are flagged as deprecated, with the message pointing to the new ... alongPath: ... methods.

This branch is currently pointed at the #148 branch. If that branch is merged first we can trivially rebase this onto master.

Downsides to this PR:

  • Swift doesn't yet support library version numbers - @available is tied to OS version releases, so we use a flat @available(*, deprecated, ...). There are plans for library versioning, but it's not around yet.
  • Our unit tests now have about a dozen warnings from calling deprecated methods. Not sure how valuable it is to keep those around now that we see that they work.

@jgallagher jgallagher added this to the 2.1 milestone Mar 23, 2016
@@ -539,3 +539,105 @@ extension JSON {
}

}

// Deprecated methods.
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you have feels about // MARK: - Deprecated methods?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I feel it should be that.

Copy link
Contributor

Choose a reason for hiding this comment

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

Haha. 👍

@mdmathias
Copy link
Contributor

I'm 👌 to merge.

I vote that we remove the deprecated method calls from our tests.

@jgallagher
Copy link
Contributor Author

👍 Made both changes and removed the deprecated tests. Merge when travis is ✅

@mdmathias mdmathias merged commit c687984 into mattmatt/ParsingOptions Mar 24, 2016
@mdmathias mdmathias deleted the jgallagher/deprecated-subscripting-options branch March 24, 2016 13:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants