Skip to content

Conversation

@Rexicon226
Copy link
Contributor

fixes #18592

@Rexicon226
Copy link
Contributor Author

I know what I did wrong, one sec! 🤣

@dweiller
Copy link
Contributor

dweiller commented Jan 17, 2024

Is it worth adding a compile error test in test/cases/compiler_errors?

@Rexicon226
Copy link
Contributor Author

Is it worth adding a compile error test in test/cases/compiler_errors?

Ah, good point.

@Rexicon226
Copy link
Contributor Author

Rexicon226 commented Jan 17, 2024

I wonder if this is something that should error somewhere in the catch logic, instead of the switch already. Like in AstGen, if possible 🤔

@dweiller
Copy link
Contributor

I don't think it can happen in astgen - the case in the issue could, but not something like:

const a = true;
a catch |e| switch (e) {
    // ...
};

@Rexicon226
Copy link
Contributor Author

Yeah, you're right. Was just a thought.

@Vexu Vexu enabled auto-merge (squash) January 17, 2024 21:34
@Vexu Vexu merged commit 6e5bdb5 into ziglang:master Jan 18, 2024
@Rexicon226 Rexicon226 deleted the patch-10 branch January 18, 2024 00:51
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

Successfully merging this pull request may close these issues.

switch on error doesn't validate operand type

3 participants