You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
module a
_a() =println("Hello there!")
function Base.getproperty(m::Module, x::Symbol)
if m === a && x ===:areturngetfield(m, :_a)
elsereturngetfield(m, x)
endendend
Executing some stuff in the REPL
julia> a.a
Main.a
julia> b = a.a
_a (generic function with 1 method)
It seems odd to me that a.a returns Main.a instead of _a. Perhaps this is the interpreter that is running and take a fast path for getproperty and type piracy like this is not supported.
The text was updated successfully, but these errors were encountered:
KristofferC
changed the title
Assignment doesnt always return RHS
Interpreter takes an invalid(?) fast path for getproperty?
Mar 1, 2019
vtjnash
changed the title
Interpreter takes an invalid(?) fast path for getproperty?
feature request: implement error for overloading "final" methods
Mar 1, 2019
👍 Yes, there are two nice features we could add here: (1) Sealed functions, where you can't add any new methods, and (2) sealed methods, where you can't replace it or add any methods more specific than it.
From a (trolly) discourse post (https://discourse.julialang.org/t/module-with-one-function-of-same-name-as-the-module/21305/3):
Executing some stuff in the REPL
It seems odd to me that
a.a
returnsMain.a
instead of_a
. Perhaps this is the interpreter that is running and take a fast path forgetproperty
and type piracy like this is not supported.The text was updated successfully, but these errors were encountered: