{"action":"closed","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/14318","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/14318/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/14318/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/14318/events","html_url":"https://github.com/JuliaLang/julia/issues/14318","id":120923733,"number":14318,"title":"`@fastmath` prevents accessing fields called `min` or `max`","user":{"login":"eschnett","id":213514,"avatar_url":"https://avatars.githubusercontent.com/u/213514?v=3","gravatar_id":"","url":"https://api.github.com/users/eschnett","html_url":"https://github.com/eschnett","followers_url":"https://api.github.com/users/eschnett/followers","following_url":"https://api.github.com/users/eschnett/following{/other_user}","gists_url":"https://api.github.com/users/eschnett/gists{/gist_id}","starred_url":"https://api.github.com/users/eschnett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eschnett/subscriptions","organizations_url":"https://api.github.com/users/eschnett/orgs","repos_url":"https://api.github.com/users/eschnett/repos","events_url":"https://api.github.com/users/eschnett/events{/privacy}","received_events_url":"https://api.github.com/users/eschnett/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/JuliaLang/julia/labels/bug","name":"bug","color":"e10c02"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-08T03:45:26Z","updated_at":"2015-12-09T16:30:12Z","closed_at":"2015-12-09T16:30:12Z","body":"This is an example of what is going wrong:\r\n```Julia\r\ntype T min::Float64 end\r\nx=T(1)\r\n\r\njulia> x.min\r\n1.0\r\n\r\njulia> @fastmath x.min\r\nERROR: TypeError: getfield: expected Symbol, got Expr\r\n```\r\n\r\nThe `@fastmath` macro replaces the symbol `min` by `fast_min` in the expression. This makes the field `min` inaccessible, as Julia now tries to access something like `x.fast_min`.\r\n\r\nThe best short-term solution is probably to not perform this replacement in `getfield` and `setfield` calls.\r\n\r\nA better solution would be to temporarily (i.e. lexically scoped) search a module `FastMath` before `Base` while resolving function names. Is this possible?"}}