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

no error when type enum is an interface without a function #1527

Closed
matt2e opened this issue May 17, 2024 · 2 comments
Closed

no error when type enum is an interface without a function #1527

matt2e opened this issue May 17, 2024 · 2 comments
Assignees

Comments

@matt2e
Copy link
Collaborator

matt2e commented May 17, 2024

Steps to repro:

  • Define an ftl type enum, but with an empty interface

Expected:

  • This should be an error on the enum, and not produce errors everywhere else

What actually happens:

  • Errors appear every else because everything is now an enum variant because it conforms to the interface
//ftl:enum
type OpenEnum interface{}

// innocent bystander
type DAL struct {
  db *sql.DB
}

error:

unsupported type "*database/sql.DB" for field "db"

@github-actions github-actions bot added the triage Issue needs triaging label May 17, 2024
@ftl-robot ftl-robot mentioned this issue May 17, 2024
@alecthomas
Copy link
Collaborator

😂

@worstell
Copy link
Contributor

we should also validate that the interface function is unexported, i don't think we're doing that right now

@worstell worstell removed the triage Issue needs triaging label May 17, 2024
@worstell worstell assigned worstell and unassigned deniseli May 18, 2024
worstell added a commit that referenced this issue May 18, 2024
small changes + fixes preempting the refactor

fixes #1531, #1527, #1496
matt2e pushed a commit that referenced this issue May 23, 2024
small changes + fixes preempting the refactor

fixes #1531, #1527, #1496
matt2e added a commit that referenced this issue May 23, 2024
Un-reverting #1535 by @worstell 
small changes + fixes preempting the refactor

fixes #1531,
#1527,
#1496

Co-authored-by: worstell <[email protected]>
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

4 participants