{"action":"closed","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/14833","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/14833/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/14833/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/14833/events","html_url":"https://github.com/JuliaLang/julia/issues/14833","id":129499684,"number":14833,"title":"typealias constructor bug?","user":{"login":"ma-laforge","id":11205411,"avatar_url":"https://avatars.githubusercontent.com/u/11205411?v=3","gravatar_id":"","url":"https://api.github.com/users/ma-laforge","html_url":"https://github.com/ma-laforge","followers_url":"https://api.github.com/users/ma-laforge/followers","following_url":"https://api.github.com/users/ma-laforge/following{/other_user}","gists_url":"https://api.github.com/users/ma-laforge/gists{/gist_id}","starred_url":"https://api.github.com/users/ma-laforge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ma-laforge/subscriptions","organizations_url":"https://api.github.com/users/ma-laforge/orgs","repos_url":"https://api.github.com/users/ma-laforge/repos","events_url":"https://api.github.com/users/ma-laforge/events{/privacy}","received_events_url":"https://api.github.com/users/ma-laforge/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"JeffBezanson","id":744556,"avatar_url":"https://avatars.githubusercontent.com/u/744556?v=3","gravatar_id":"","url":"https://api.github.com/users/JeffBezanson","html_url":"https://github.com/JeffBezanson","followers_url":"https://api.github.com/users/JeffBezanson/followers","following_url":"https://api.github.com/users/JeffBezanson/following{/other_user}","gists_url":"https://api.github.com/users/JeffBezanson/gists{/gist_id}","starred_url":"https://api.github.com/users/JeffBezanson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JeffBezanson/subscriptions","organizations_url":"https://api.github.com/users/JeffBezanson/orgs","repos_url":"https://api.github.com/users/JeffBezanson/repos","events_url":"https://api.github.com/users/JeffBezanson/events{/privacy}","received_events_url":"https://api.github.com/users/JeffBezanson/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2016-01-28T16:24:51Z","updated_at":"2016-01-29T04:50:16Z","closed_at":"2016-01-29T04:50:16Z","body":"(Julia v0.4.1)\r\nBuilding a constructor from a parameterized type alias does not appear to work:\r\n\r\n\ttype MyType{T1,T2}\r\n\t\tv::T1\r\n\t\tv2::T2\r\n\tend\r\n\r\n\ttypealias MyType2 MyType{Float64}\r\n\ttypealias MyType3 MyType{Float32}\r\n\ttypealias MyType4{T2} MyType{Int, T2}\r\n\r\n\tMyType{T<:Integer}(v::Vector{T}) = :MTv #OK\r\n\tMyType{T<:Integer}(v::Vector{T},b) = :MTva #OK\r\n\tMyType2{T<:Integer}(v::Vector{T}) = :MT2v #OK\r\n\tMyType3{T<:Integer}(v::Vector{T}) = :MT3v #OK\r\n\tMyType4{T<:Integer}(v::Vector{T}) = :MT4v #No good\r\n\t => LoadError: cannot define function MyType4; it already has a value\r\n\r\nNOTE:\r\n - If the typealias is not parameterized, the \"constructor\" syntax works.  I call this a \"constructor\", assuming it would normally return a new MyType{...} - not just a symbol.\r\n - I can get the MyType4 \"constructor\" to work only with the more verbose \"call\" syntax:\r\n\r\n\t\tcall{T<:Integer}(::Type{MyType4}, v::Vector{T}) = :MT4v\r\n\r\nIf there is no fundamental reason for the more succinct syntax to work on parameterized types, it would make code easier to read/maintain."}}