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
alias My.Schema.User
alias My.Schema.Account
@module_map %{
account: Account,
user: User,
...
}
IIRC correctly these do not generate compile time dependencies if the attributes are used inside a function only. Run mix trace to double check though.
Wow, I double-checked because I also thought these generated compile-time dependencies, and of course you are correct, very nice. The output that mix trace gives is a bit surprising, it lists at the end of a file with "nofile:" as the source, e.g., when line 28 uses the @example to call a function of a module
Compiling 1 file (.ex)
lib/my_file.ex:5: require MyApp.Something... (export)
lib/my_file.ex:5: call MyApp.Something.../1 (compile)
lib/my_file.ex:11: alias MyApp.Something... (runtime)
lib/my_file.ex:27: alias MyApp.Something... (runtime)
lib/my_file.ex:48: alias MyApp.Something... (runtime)
...
lib/my_file.ex:282: call MyApp.Something.../2 (runtime)
lib/my_file.ex:283: call MyApp.Something.../2 (runtime)
nofile:27: alias MyApp.Something... (compile)
Unfortunately we don't have the file information at that point, but I made it point to @attrname:LINE:, where the line is where it is accessed (not where it is defined).
Uh oh!
There was an error while loading. Please reload this page.
Wow, I double-checked because I also thought these generated compile-time dependencies, and of course you are correct, very nice. The output that
mix trace
gives is a bit surprising, it lists at the end of a file with "nofile:" as the source, e.g., when line 28 uses the@example
to call a function of a moduleOriginally commented at #13762 (comment)
The text was updated successfully, but these errors were encountered: