'Unable to parse module: ErrorMessage { msg: "ParserError: Invalid token at 144" }

I successfully started a local swarm with 4 nodes all good there, now I am trying to compile the following example:

module MyModule {
 import 0x0.LibraCoin;

 // The identity function for coins: takes a LibraCoin.T as input and hands it back
 public id(c: R#LibraCoin.T): R#LibraCoin.T {
   return move(c);
 }
}

But I am getting the following error:
Unable to parse module: ErrorMessage { msg: "ParserError: Invalid token at 144" }

If I remove both “R#” occurrences it does compile successfully. Any idea why it’s not accepting R#?

Thanks!! :+1:

1 Like

Hi Juan,

We made kind annotations (R#/V#) optional in #472, and removed them in #539 to make the IR syntax less verbose. The compiler will now look up the struct definition and determine the kind for you.

2 Likes

Oh that’s even better, thanks for your prompt reply @vgao :+1:

>> Compiling program
Finished dev [unoptimized + debuginfo] target(s) in 0.68s
 Running `target/debug/compiler -l /var/folders/1r/yjfqkjdx74n_1y3ct2kk12f00000gn/T/2f3d36e9a91da34d85d56e450e9b517e -m`
Finished dev [unoptimized + debuginfo] target(s) in 0.40s
 Running `target/debug/compiler -a 451ebecbdf1055fc18517cfc9a6fc8fcfd79f80dd0504bd40c0dac88bb18a83c -o /var/folders/1r/yjfqkjdx74n_1y3ct2kk12f00000gn/T/51d8b85d1aab586364f8b638b1059a8e /var/folders/1r/yjfqkjdx74n_1y3ct2kk12f00000gn/T/2f3d36e9a91da34d85d56e450e9b517e`
Successfully compiled a program at /var/folders/1r/yjfqkjdx74n_1y3ct2kk12f00000gn/T/51d8b85d1aab586364f8b638b1059a8e

It works!

1 Like