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

Support accessing renamed resource variables #72

Open
jianzs opened this issue Nov 21, 2023 · 0 comments
Open

Support accessing renamed resource variables #72

jianzs opened this issue Nov 21, 2023 · 0 comments
Labels
deducer Deducer generator Generator

Comments

@jianzs
Copy link
Contributor

jianzs commented Nov 21, 2023

Currently, Pluto does not support accessing resource variables that have been renamed.

import { Router, HttpRequest, HttpResponse, Queue } from "@plutolang/pluto";

const router = new Router("router");

const queue = new Queue("queue");
const aliasQueue = queue;  // Will not appear in the generated computing module code

router.get("/store", async (req: HttpRequest): Promise<HttpResponse> => {
  await queue.push("foo");  // Valid
  await aliasQueue.push("bar");  // Invalid
  return {
    statusCode: 200,
    body: `Fetch access message.`,
  };
});
@jianzs jianzs added deducer Deducer generator Generator labels Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deducer Deducer generator Generator
Projects
None yet
Development

No branches or pull requests

1 participant