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

Update TODO for semantic checking #4821

Merged
merged 2 commits into from
Jan 21, 2025
Merged

Conversation

jonmeow
Copy link
Contributor

@jonmeow jonmeow commented Jan 17, 2025

I believe check_syntax is already controlling the semantic vs syntactic merge, added in #4149. Other parts of the TODO are clarified per discussion. But this is tested, e.g. errors with the bool flipped:

 impl i32 as I {
+  // CHECK:STDERR: method.carbon:[[@LINE+6]]:14: error: redeclaration syntax di
ffers here [RedeclParamSyntaxDiffers]
+  // CHECK:STDERR:   fn F[self: i32](other: i32) -> i32 = "int.sadd";
+  // CHECK:STDERR:              ^~~
+  // CHECK:STDERR: method.carbon:[[@LINE-7]]:14: note: comparing with previous
declaration here [RedeclParamSyntaxPrevious]
+  // CHECK:STDERR:   fn F[self: Self](other: Self) -> Self;
+  // CHECK:STDERR:              ^~~~
   fn F[self: i32](other: i32) -> i32 = "int.sadd";
 }

@jonmeow
Copy link
Contributor Author

jonmeow commented Jan 17, 2025

(@dwblaikie mainly looking for @zygoloid to clarify whether I'm misunderstanding)

@zygoloid
Copy link
Contributor

I think the TODO is out of date regarding syntactic vs semantic matching, but there's still more to do here. We should be checking whether there's an implicit conversion from the original parameter types to the overriding parameter types and from the overriding return type to the original return type, and building a thunk if necessary.

@zygoloid
Copy link
Contributor

Hm, maybe just delete the first sentence of the TODO?

@jonmeow
Copy link
Contributor Author

jonmeow commented Jan 18, 2025

Hm, maybe just delete the first sentence of the TODO?

How's this? I copied your response into the TODO. :)

@jonmeow jonmeow changed the title Remove TODO for semantic checking Update TODO for semantic checking Jan 21, 2025
@jonmeow jonmeow added this pull request to the merge queue Jan 21, 2025
Merged via the queue into carbon-language:trunk with commit 41b6bb5 Jan 21, 2025
8 checks passed
@jonmeow jonmeow deleted the impl-todo branch January 21, 2025 17:26
dwblaikie pushed a commit to dwblaikie/carbon-lang that referenced this pull request Jan 21, 2025
I believe `check_syntax` is already controlling the semantic vs
syntactic merge, added in carbon-language#4149. Other parts of the TODO are clarified
per discussion. But this is tested, e.g. errors with the bool flipped:

```
 impl i32 as I {
+  // CHECK:STDERR: method.carbon:[[@line+6]]:14: error: redeclaration syntax di
ffers here [RedeclParamSyntaxDiffers]
+  // CHECK:STDERR:   fn F[self: i32](other: i32) -> i32 = "int.sadd";
+  // CHECK:STDERR:              ^~~
+  // CHECK:STDERR: method.carbon:[[@Line-7]]:14: note: comparing with previous
declaration here [RedeclParamSyntaxPrevious]
+  // CHECK:STDERR:   fn F[self: Self](other: Self) -> Self;
+  // CHECK:STDERR:              ^~~~
   fn F[self: i32](other: i32) -> i32 = "int.sadd";
 }
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants