summaryrefslogtreecommitdiffstats
path: root/tests/language-feature/interfaces/argument-direction-mismatch.slang
Commit message (Collapse)AuthorAge
* Fix confusing error messages for interface return type mismatches (#7854)Copilot2025-07-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Initial plan * Add improved diagnostic for interface return type mismatches Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> * Complete fix for interface return type mismatch error reporting Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> * Move diagnostic to synthesis phase for better interface return type mismatch errors Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> * Remove extraneous test file and update .gitignore Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> * Add diagnostic test for interface return type mismatch and apply formatting Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> * Address feedback: restore whitespace and use filecheck for diagnostic test Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> * Fix logic error in return type mismatch detection Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> * Remove unnecessary flag by using out parameter for diagnostic tracking Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> * Refactor witness synthesis failure reporting to use structured approach Replace ad-hoc `outSpecificDiagnosticEmitted` parameter with `WitnessSynthesisFailureReason` enum and `MethodWitnessSynthesisFailureDetails` struct as requested in code review. This provides: - Clear taxonomy of failure reasons (General, MethodResultTypeMismatch, MethodParameterMismatch) - Centralized diagnostic emission in findWitnessForInterfaceRequirement - Better extensibility for future failure types - Improved maintainability by removing state tracking flags The return type mismatch diagnostic continues to work correctly, showing error 38106 with precise location information. Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> * Remove unused MethodParameterMismatch enum and duplicate code Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> * Remove redundant requiredMethod field from MethodWitnessSynthesisFailureDetails Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> * Address feedback: add outFailureDetails guard and remove unnecessary hasReturnTypeError variable Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> * Fix regression: restore original diagnostic message for mutating method mismatch Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> * Fix. * Fix. * Remove `innerSink`. * Print candidates considered for interface match upon error. * Fix tests. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> Co-authored-by: Yong He <yonghe@outlook.com>
* Check mismatching method parameter direction against interface declaration. ↵Yong He2024-12-30
(#5964)