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

Disallow duplicate declaration names #1234

Closed
infomiho opened this issue Jun 6, 2023 · 1 comment · Fixed by #2015
Closed

Disallow duplicate declaration names #1234

infomiho opened this issue Jun 6, 2023 · 1 comment · Fixed by #2015
Assignees
Labels
bug Something isn't working compiler

Comments

@infomiho
Copy link
Contributor

infomiho commented Jun 6, 2023

While working on the crud feature, I've noticed that if you declare two cruds with the same name, the analyzer will allow it.

The generator then fails due to "duplicate file draft file names" which is just a symptom.

Internal Wasp error (bug in compiler):
  FileDraft destination paths are not unique! Duplicates include:
  Left (RelFile "server/src/crud/tasks.ts" NoPrefix)
  Left (RelFile "server/src/routes/crud/tasks.ts" NoPrefix)
  Left (RelFile "web-app/src/crud/tasks.ts" NoPrefix)

  CallStack (from HasCallStack):
    error, called at src/Wasp/Generator/WriteFileDrafts.hs:72:48 in waspc-0.10.6-inplace:Wasp.Generator.WriteFileDrafts

We should ideally handle this head on by not allowing duplicate declaration names.

@infomiho infomiho added bug Something isn't working compiler labels Jun 6, 2023
@Martinsos
Copy link
Member

I believe this is the same problem that is routes to have same names: #579

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants