Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shared function in a module should produce an error, shouldn't it? #4838

Open
vporton opened this issue Jan 5, 2025 · 0 comments
Open

Shared function in a module should produce an error, shouldn't it? #4838

vporton opened this issue Jan 5, 2025 · 0 comments

Comments

@vporton
Copy link

vporton commented Jan 5, 2025

module {
  public query func greet(name : Text) : async Text {
    return "Hello, " # name # "!";
  };
};

This Motoko source compiles without errors. But isn't a shared query function meaningless in a module? Shouldn't it appear only in an actor?

I think, compiling this should produce an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant