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

Add at-compat for new type declaration syntax and fix depwarn in tests #325

Merged
merged 1 commit into from
Feb 11, 2017

Conversation

yuyichao
Copy link
Contributor

No description provided.

@yuyichao
Copy link
Contributor Author

Another question is if we should implement something like

@struct typename{T} <: basetype{T} begin
    field::T
end
@mutable typename2{T} <: basetype2{T} begin
    field::T
end

Similar to (but uglier than) the soon to be removed @Dict macro etc.

README.md Outdated
@@ -71,6 +71,10 @@ Currently, the `@compat` macro supports the following syntaxes:
* `@compat Array{<:Real}` and similar uses of `<:T` to define a set of parameterized types ([#20414]).
In 0.4 and 0.5, this only works for non-nested usages (e.g. you can't define `Array{<:Array{<:Real}}`).

* `@compat abstract type T end` and `@compat primitive type T 8 end`
to declare abstract and primitive types. This only work when
Copy link
Contributor

Choose a reason for hiding this comment

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

only works when

xref the base PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@@ -1353,8 +1353,10 @@ end
end
@test do_boundscheck() == true

@test Compat.promote_eltype_op(@functorize(+), ones(2,2), 1) === Float64
@test Compat.promote_eltype_op(@functorize(*), ones(Int, 2), zeros(Int16,2)) === Int
if VERSION < v"0.6.0-dev.1886"
Copy link
Contributor

Choose a reason for hiding this comment

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

what changed here?

Copy link
Contributor

Choose a reason for hiding this comment

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

promote_eltype_op was deprecated?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right

Copy link
Contributor

Choose a reason for hiding this comment

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

would be worth a comment to that effect

@yuyichao
Copy link
Contributor Author

The 14 packages I've tested works well with this, with only JLD showing a small parser issue that isn't really caused by this macro (type A $b end is parsed as type $(A, b) end). Will merge shortly.

@yuyichao yuyichao merged commit 1edb00f into master Feb 11, 2017
@yuyichao yuyichao deleted the yyc/type branch February 11, 2017 21:27
martinholters added a commit that referenced this pull request Aug 27, 2018
Was added in #325, now obsolete as no longer required on minimum 
supported Julia version 0.6.
martinholters added a commit that referenced this pull request Aug 31, 2018
* Remove at-compat for type aliases

  Was added in #326, now obsolete as no longer required on minimum
  supported Julia version 0.6.

* Remove at-compat for Nullable construction

  Was added in #287, now obsolete as no longer required on minimum 
  supported Julia version 0.6.

* Remove at-compat for Foo{<:Bar} sugar

  Was added in #317 (and #336), now obsolete as no longer required on 
  minimum supported Julia version 0.6.

* Remove at-compat for index styles

  Was added in #329, now obsolete as no longer required on minimum 
  supported Julia version 0.6.

* Remove at-compat for type declarations

  Was added in #325, now obsolete as no longer required on minimum 
  supported Julia version 0.6.

* Remove unused at-compat helper functions

* Remove README entries for removed at-compat functionality

  * new style call overloading (added in #181, removed in #385)
  * `get(io, s false)` (added in #212, #215, #225, removed in #385)
  * `.=` (added in #292 and #316, removed in #372)

* Remove `Compat.collect(A)`

  Was added in #350 and #351, now obsolete as no longer required on 
  minimum supported Julia version 0.6.
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