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

typealias bug ? #6721

Closed
Jutho opened this issue May 2, 2014 · 4 comments
Closed

typealias bug ? #6721

Jutho opened this issue May 2, 2014 · 4 comments
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior types and dispatch Types, subtyping and method dispatch
Milestone

Comments

@Jutho
Copy link
Contributor

Jutho commented May 2, 2014

Since this did not get answered on the user forum, I expect nobody knows and this is a potential bug.
Starting with the following definitions

abstract Vartype
type VT1<:Vartype
end

abstract Graph{T<:Vartype}
abstract Subgraph{T<:Vartype} <: Graph{T}
type Vertex{T<:Vartype} <: Subgraph{T}
end
type Block{T<:Vartype,N} <: Subgraph{T}
end

abstract GraphObject{T<:Vartype}
type SubgraphObject{T<:Vartype,S<:Subgraph{T}} <: GraphObject{T}
end

typealias VertexObject{T<:Vartype} SubgraphObject{T,Vertex{T}}
typealias BlockObject{T<:Vartype,N} SubgraphObject{T,Block{T,N}}
typealias VertexBlockObject{T<:Vartype} Union(VertexObject{T},BlockObject{T})

O1=SubgraphObject{VT1,Vertex{VT1}}()
O2=SubgraphObject{VT1,Block{VT1,3}}()

I did expect all of the following to be true, but nevertheless got the results in the comment

isa(O1,VertexObject) # false
isa(O1,VertexObject{VT1}) # true
isa(O1,VertexBlockObject) # false
isa(O1,VertexBlockObject{VT1}) # true

isa(O2,BlockObject) # false
isa(O2,BlockObject{VT1}) # false
isa(O2,BlockObject{VT1,3}) # true
isa(O2,VertexBlockObject) # false
isa(O2,VertexBlockObject{VT1}) # false

I don't see how this is different to isa(randn(3,3),StridedMatOrVec), which returns true with or without full specification of the argument.

Is this a bug or expected behaviour?

@kshyatt
Copy link
Contributor

kshyatt commented Sep 14, 2016

Is this 2.5 year old bug still a problem?

@JeffBezanson
Copy link
Member

Yep, but is fixed by #18457.

@StefanKarpinski StefanKarpinski added this to the 0.5.x milestone Sep 14, 2016
@vtjnash vtjnash removed this from the 0.5.x milestone Sep 15, 2016
@vtjnash
Copy link
Member

vtjnash commented Sep 15, 2016

@StefanKarpinski I'm pretty certain we won't backport that fix

@StefanKarpinski
Copy link
Member

then put the 0.6 label on it

@StefanKarpinski StefanKarpinski added this to the 0.6.0 milestone Sep 15, 2016
JeffBezanson added a commit that referenced this issue Nov 4, 2016
JeffBezanson added a commit that referenced this issue Nov 7, 2016
JeffBezanson added a commit that referenced this issue Nov 7, 2016
JeffBezanson added a commit that referenced this issue Nov 8, 2016
JeffBezanson added a commit that referenced this issue Nov 8, 2016
JeffBezanson added a commit that referenced this issue Nov 11, 2016
e.g. fixes #6721

fixes to type instantiation

[ci skip]
JeffBezanson added a commit that referenced this issue Nov 15, 2016
e.g. fixes #6721

fixes to type instantiation

[ci skip]
JeffBezanson added a commit that referenced this issue Nov 15, 2016
e.g. fixes #6721

fixes to type instantiation

[ci skip]
JeffBezanson added a commit that referenced this issue Nov 22, 2016
e.g. fixes #6721

fixes to type instantiation

[ci skip]
JeffBezanson added a commit that referenced this issue Dec 12, 2016
e.g. fixes #6721

fixes to type instantiation

[ci skip]
JeffBezanson added a commit that referenced this issue Dec 18, 2016
e.g. fixes #6721

fixes to type instantiation

[ci skip]
JeffBezanson added a commit that referenced this issue Dec 28, 2016
e.g. fixes #6721

fixes to type instantiation

[ci skip]
JeffBezanson added a commit that referenced this issue Dec 30, 2016
e.g. fixes #6721

fixes to type instantiation

[ci skip]
JeffBezanson added a commit that referenced this issue Dec 30, 2016
e.g. fixes #6721

fixes to type instantiation

[ci skip]
JeffBezanson added a commit that referenced this issue Dec 31, 2016
e.g. fixes #6721

fixes to type instantiation

[ci skip]
JeffBezanson added a commit that referenced this issue Dec 31, 2016
e.g. fixes #6721

fixes to type instantiation

[ci skip]
JeffBezanson added a commit that referenced this issue Jan 2, 2017
e.g. fixes #6721

fixes to type instantiation

[ci skip]
JeffBezanson added a commit that referenced this issue Jan 5, 2017
e.g. fixes #6721

fixes to type instantiation

[ci skip]
JeffBezanson added a commit that referenced this issue Jan 7, 2017
e.g. fixes #6721

fixes to type instantiation

[ci skip]
JeffBezanson added a commit that referenced this issue Jan 7, 2017
JeffBezanson added a commit that referenced this issue Jan 9, 2017
yuyichao pushed a commit that referenced this issue Jan 9, 2017
yuyichao pushed a commit that referenced this issue Jan 9, 2017
JeffBezanson added a commit that referenced this issue Jan 9, 2017
JeffBezanson added a commit that referenced this issue Jan 10, 2017
JeffBezanson added a commit that referenced this issue Jan 12, 2017
JeffBezanson added a commit that referenced this issue Jan 12, 2017
Keno pushed a commit that referenced this issue Jan 12, 2017
JeffBezanson added a commit that referenced this issue Jan 13, 2017
JeffBezanson added a commit that referenced this issue Jan 13, 2017
Keno pushed a commit that referenced this issue Jan 15, 2017
JeffBezanson added a commit that referenced this issue Jan 16, 2017
e.g. fixes #6721

fixes to type instantiation

get several test suites passing

remove ambiguous `convert` definition

add some disambiguating definitions for sparse `map`

fix a method ambiguity in RowVector

fix check for iterability in Dict constructor

[ci skip]
JeffBezanson added a commit that referenced this issue Jan 16, 2017
e.g. fixes #6721

fixes to type instantiation

get several test suites passing

remove ambiguous `convert` definition

add some disambiguating definitions for sparse `map`

fix a method ambiguity in RowVector

fix check for iterability in Dict constructor

[ci skip]
@vtjnash vtjnash mentioned this issue Jan 16, 2017
53 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior types and dispatch Types, subtyping and method dispatch
Projects
None yet
Development

No branches or pull requests

6 participants