Skip to content

Weird behavior on evaluations after execute op refresh #918

@afucher

Description

@afucher

After execute the op refresh seems that not all places are getting the new code, leading to an unexpected result after evaluations.

I have two files foo.clj and baz.clj (branch in github)

;;foo.clj
(defn some-function []
  "-foo")
;;baz.clj
(defn baz []
  (clojure-sample.foo/some-function))

(baz)

(clojure-sample.foo/some-function)

If I change the some-function to return -foz , call the op refresh and try to eval the function baz it returns the old value (-foo) but calling directly the function returns the new value

(baz) ;;=> "-foo"

(clojure-sample.foo/some-function) ;;=> "-foz"

If I evaluate the definition of baz or evaluate some-function again or load foo.clj file, it works. The behavior just happens after using the refresh op.

Additional Info

Reproduced on clojure-repl-intellj (plugin for IntelliJ) and Emacs
slack thread

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions