'Why do I get IllegalAccessError when trying to import a protocol or record from another namespace

I have a file in my project where I define a few protocols and records (defprotocol and defrecord).

I'm trying to use them in a different file/namespace like this:

(ns myapp.core
  (:require [myapp.protocols :refer [SomeProtocol]]))

This causes an Execution error (IllegalAccessError) at .... Does anyone know why?

btw, doing :refer :all does work but I don't want to bring in several unneeded symbols into the namespace.

thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source