-
Notifications
You must be signed in to change notification settings - Fork 6
bug: [移动端] MentionSessionController 命名参数以下划线开头导致编译失败 #698
Copy link
Copy link
Open
Labels
area:mobile移动端 Flutter移动端 Flutteroryn:kind: 🐛 bugBehavior differs from the intended result.Behavior differs from the intended result.oryn:priority: 🟠 P1High-priority impact supported by the review.High-priority impact supported by the review.oryn:proof: 🔎 supportedEvidence supports this conclusion; see the report for source vs live proof.Evidence supports this conclusion; see the report for source vs live proof.oryn:status: 🧭 needs inputA maintainer decision or additional information is required.A maintainer decision or additional information is required.priority:P1type:bug🐛 bugReported defect requiring investigationReported defect requiring investigation
Description
Activity
Metadata
Metadata
Assignees
Labels
area:mobile移动端 Flutter移动端 Flutteroryn:kind: 🐛 bugBehavior differs from the intended result.Behavior differs from the intended result.oryn:priority: 🟠 P1High-priority impact supported by the review.High-priority impact supported by the review.oryn:proof: 🔎 supportedEvidence supports this conclusion; see the report for source vs live proof.Evidence supports this conclusion; see the report for source vs live proof.oryn:status: 🧭 needs inputA maintainer decision or additional information is required.A maintainer decision or additional information is required.priority:P1type:bug🐛 bugReported defect requiring investigationReported defect requiring investigation
Type
Projects
- StatusShow more project fieldsInbox
问题概述
MentionSessionController构造函数声明了一个以下划线开头的命名参数:Dart 语言规范禁止命名参数以下划线开头(analyzer 报错:"Named parameters can't start with an underscore"),且
_searchUsers作为私有字段名对调用方不可寻址。结果:该库及其全部测试都无法编译。影响
apps/mobile/packages/forum_app编译失败,CI 门禁(ci-mobile)必然红灯。searchUsers:(topic_page.dart:114及mention_panel_test.dart/mention_session_test.dart全部用例),与声明参数名不匹配,即使去掉下划线限制也无法绑定。证据
required this._searchUsersfinal Future<List<MentionUser>> Function(String query) _searchUsers;searchUsers:命名参数复现
或运行任意
mention_session_test.dart/mention_panel_test.dart用例。预期行为
库与测试能够编译,
searchUsers参数可正常传入。实际行为
编译失败(
Named parameters can't start with an underscore)。建议修复
将参数公开化并转发给私有字段:
来源:OCR review session
b0a6067d(HEAD~30..HEAD)critical 级发现。