Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[K-Bug] Broken "Non-exhausive match" warning

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

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

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Lĩnh vực
compilers

Hướng nghiên cứu

The reproducer is in a.k; begin by running kompile a.k with K v7.1.104 and confirm the non-exhaustive match warning. Compare it with the version where the parentheses around item are removed, and consider the issue complete when the original definition compiles without that warning.

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

Mô tả

What component is the issue in?

Front-End

Which command
  • kompile
  • kast
  • krun
  • kprove
  • kprovex
  • ksearch
What K Version?

K version: v7.1.104-0-g34892bf1cc Build date: Mi aug 14 01:57:38 EEST 2024

Operating System

Linux

K Definitions (If Possible)

a.k:

module A
    syntax Item ::= "item"
    syntax ItemList ::= List{Item, ","}

    syntax ItemList ::= reverse(ItemList)  [function, total]
                      | #reverse(ItemList, ItemList)  [function, total]
    rule reverse(L:ItemList) => #reverse(L, .ItemList)
    rule #reverse(.ItemList, R) => R
    rule #reverse((P:Item , L:ItemList), R)
        => #reverse(L, (P , R))

    syntax A  ::= "a"
                | b(ItemList)
    rule a => b((item))
endmodule
Steps to Reproduce
$ kompile a.k
[Warning] Compiler: Non exhaustive match detected:
`#reverse(_,_)_A_ItemList_ItemList_ItemList`(_,_)
        Source(/mnt/data/pi-squared/rust-demo-semantics/tmp/a.k)
        Location(6,25,6,72)
        6 |                           | #reverse(ItemList, ItemList)  [function, total]
          .                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Note that if the parentheses around item in rule a => b((item)) are removed, the warning dissapears.

Expected Results

No "Non-exhausive match" warning.

Ngôn ngữ chính
Python
Star
594
Fork
164
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

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 runtimeverification/k

Tất cả issue của runtimeverification/k

Issue tương tự

Thêm issue về Python

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.