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

Deprecate assert function. #26194

Merged

Conversation

twadleigh
Copy link
Contributor

@twadleigh twadleigh commented Feb 24, 2018

Addresses #8856. Tests pass locally for me. The deprecation warning message is currently mangled. The warning looks like:

julia> assert(true)
┌ Warning: `assert` is deprecated, use `@assert` instead.
│   caller = top-level scope
└ @ Core :0

@twadleigh twadleigh force-pushed the tw/deprecate-assert-function branch from dba04a9 to 0c62376 Compare February 24, 2018 19:14
@@ -168,7 +168,7 @@ struct IOContext{IO_t <: IO} <: AbstractPipe
dict::ImmutableDict{Symbol, Any}

function IOContext{IO_t}(io::IO_t, dict::ImmutableDict{Symbol, Any}) where IO_t<:IO
assert(!(IO_t <: IOContext))
@assert !(IO_t <: IOContext) "Cannot create `IOContext` from another `IOContext`."
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Had to add a message here to keep the build happy.

@twadleigh twadleigh force-pushed the tw/deprecate-assert-function branch from 0c62376 to a4833a5 Compare February 24, 2018 19:27
@twadleigh twadleigh changed the title Deprecate assert function. Addresses #8856. Deprecate assert function. Feb 24, 2018
@twadleigh twadleigh force-pushed the tw/deprecate-assert-function branch 4 times, most recently from 1329134 to 912ad04 Compare February 24, 2018 23:56
depwarn("`assert` is deprecated, use `@assert` instead.", :assert)
@assert x ""
end

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't use vanilla @deprecate because the resulting warning message was a little mangled.

@twadleigh twadleigh force-pushed the tw/deprecate-assert-function branch 2 times, most recently from dbebb37 to 2ee03b1 Compare February 25, 2018 00:36
@twadleigh twadleigh force-pushed the tw/deprecate-assert-function branch from 2ee03b1 to 96813aa Compare February 25, 2018 01:50
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.

3 participants