extract: namespaced C++ this->m and parameter p->m accesses file under different container types

Đang mở
#198 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
cpp, rust
Lĩnh vực
backend, devtools

Hướng nghiên cứu

Start by reading commit dbb20a0 and trace how semcode records C++ member accesses for this and parameter types, especially namespace resolution. The issue does not name source files or tests, so locate the relevant extractor code and existing C++ access tests first. Done means both accesses resolve to outer::Box and a regression test confirms querying outer::Box::m returns both.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Inside a C++ namespace, member data accesses through this and through a parameter of the same class are recorded under different container_type keys, so a single accesses query misses half the accesses.

Reproducer

namespace outer {
struct Box { int m; void touch(); };
void Box::touch() { this->m = 1; }
void g(Box *p) { p->m = 2; }
}
  • this->m in Box::touch is recorded with container_type = Some("outer::Box").
  • p->m in g is recorded with container_type = Some("Box") (the spelling written in the parameter list).

Cause

Documented in dbb20a0: this takes the enclosing owner's full namespace-qualified path, while parameter types are recorded as written without namespace qualification.

Expected behavior

Both this->m and p->m inside namespace outer should resolve to the same container (outer::Box) so querying outer::Box::m returns both accesses.

Ngôn ngữ chính
Rust
Star
187
Fork
53
Merge trung bình
1 ngày 9 giờ
Pull request đã merge (30 ngày)
79

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của facebookexperimental/semcode

Tất cả issue của facebookexperimental/semcode

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.