Day_3_challenge type error [M0031], shared function has non-shared parameter type [Nat/3] #77
-
Hello, I'm tryna to test my swap function but I run into this error when I deploy. :22.31-22.46: type error [M0031], shared function has non-shared parameter type |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Oh, it looks like your swap_test=> you dont need the because thats for generics. So what those brackets do is like if you wanted to use an arbitrary type to call later on you do swap_test (array:[A]) |
Beta Was this translation helpful? Give feedback.
Oh, it looks like your swap_test=> you dont need the because thats for generics.
So what those brackets do is like if you wanted to use an arbitrary type to call later on you do swap_test (array:[A])
So that when you use it in another canister, the type is generic. but here youre putting in a Nat in the brackets which isnt a representation for a generic type. Also, generic functions can't be public. Make that private as well