Skip to content

Can you define methods to call during runtime of a module? #159

Discussion options

You must be logged in to vote

No, this is not possible. Aptos Move uses static dispatch, as of April 23rd, 2024.


You'll receive errors from the Aptos CLI when attempting to compile the code, like:

error[E03001]: address with no value
   ┌─ /Users/user/Documents/aptos/aptos-dev-discussions-playground/can_you_dynamic_dispatch/sources/dispatch_test.move:11:8
   │
11 │        module_addr::module_name::func_name();
   │        ^^^^^^^^^^^ address 'module_addr' is not assigned a value

error[E03002]: unbound module
   ┌─ /Users/user/Documents/aptos/aptos-dev-discussions-playground/can_you_dynamic_dispatch/sources/dispatch_test.move:11:8
   │
11 │        module_addr::module_name::func_name();
   │        ^^^^^^^^^^^^^^^^^^^…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@gregnazario
Comment options

Answer selected by gregnazario
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
move Questions related to the Move Language
2 participants