FStarLang / FStarLang/FStar

Qualifiers on indices of inductive are not strictly checked

Open
#2,182 0 comments 0 reactions 0 assignees View on GitHub
component/typechecker kind/bug
Dominant language
F*
Stars
3.1k
Forks
267
Avg merge
10h 45m
Merged PRs (30d)
54

Description

Both of the definitions below are accepted, but only the second one should work.
```fstar
module Bug

type test : int -> Type =
| Make :
i:int ->
test 23

let proj_0 #i (r : test i) : int = match r with | Make #i -> i
let proj_1 #i (r : test i) : int = match r with | Make i -> i
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the two F* definitions from the issue and compare how the inductive index qualifiers are checked in each match. Done means the definition using `Make #i` is rejected while the definition using `Make i` remains accepted.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.