{"action":"closed","issue":{"url":"https://api.github.com/repos/ajkeller34/Unitful.jl/issues/168","repository_url":"https://api.github.com/repos/ajkeller34/Unitful.jl","labels_url":"https://api.github.com/repos/ajkeller34/Unitful.jl/issues/168/labels{/name}","comments_url":"https://api.github.com/repos/ajkeller34/Unitful.jl/issues/168/comments","events_url":"https://api.github.com/repos/ajkeller34/Unitful.jl/issues/168/events","html_url":"https://github.com/ajkeller34/Unitful.jl/issues/168","id":368895170,"node_id":"MDU6SXNzdWUzNjg4OTUxNzA=","number":168,"title":"Promoting irrationals and quantities","user":{"login":"ajkeller34","id":7145721,"node_id":"MDQ6VXNlcjcxNDU3MjE=","avatar_url":"https://avatars3.githubusercontent.com/u/7145721?v=4","gravatar_id":"","url":"https://api.github.com/users/ajkeller34","html_url":"https://github.com/ajkeller34","followers_url":"https://api.github.com/users/ajkeller34/followers","following_url":"https://api.github.com/users/ajkeller34/following{/other_user}","gists_url":"https://api.github.com/users/ajkeller34/gists{/gist_id}","starred_url":"https://api.github.com/users/ajkeller34/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajkeller34/subscriptions","organizations_url":"https://api.github.com/users/ajkeller34/orgs","repos_url":"https://api.github.com/users/ajkeller34/repos","events_url":"https://api.github.com/users/ajkeller34/events{/privacy}","received_events_url":"https://api.github.com/users/ajkeller34/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-10T23:34:26Z","updated_at":"2018-10-11T19:43:37Z","closed_at":"2018-10-11T19:43:37Z","author_association":"OWNER","body":"```\r\njulia> promote(π, u\"180°\")\r\nERROR: StackOverflowError:\r\nStacktrace:\r\n [1] promote_type(::Type{Irrational{:π}}, ::Type{Quantity{Int64,Unitful.Dimensions{()},Unitful.FreeUnits{(Unitful.Unit{:Degree,Unitful.Dimensions{()}}(0, 1//1),),Unitful.Dimensions{()}}}}) at ./promotion.jl:221\r\n [2] promote_rule(::Type{Irrational{:π}}, ::Type{Quantity{Int64,Unitful.Dimensions{()},Unitful.FreeUnits{(Unitful.Unit{:Degree,Unitful.Dimensions{()}}(0, 1//1),),Unitful.Dimensions{()}}}}) at ./irrationals.jl:26\r\n ... (the last 2 lines are repeated 39998 more times)\r\n [79999] promote_type(::Type{Irrational{:π}}, ::Type{Quantity{Int64,Unitful.Dimensions{()},Unitful.FreeUnits{(Unitful.Unit{:Degree,Unitful.Dimensions{()}}(0, 1//1),),Unitful.Dimensions{()}}}}) at ./promotion.jl:221\r\n```\r\n\r\nThis problem arises because `real(typeof(u\"180°\")) == typeof(u\"180°\")` instead of `Int`, which violates some assumptions in how promotion of abstract irrationals works. However, this is in keeping with the documented behavior for `real(T::Type)`, which is defined to give `typeof(real(zero(T)))`. A fix is on its way."}}
{"actor":{"display_login":"ajkeller34"}}