-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Conversation
(@dwblaikie mainly looking for @zygoloid to clarify whether I'm misunderstanding) |
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. |
Hm, maybe just delete the first sentence of the TODO? |
How's this? I copied your response into the TODO. :) |
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"; } ```
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: