Skip to content

Checking exports blows up with abstract inductive and private predicate that matches on the inductive #1112

@aseemr

Description

@aseemr

This code gives an error:

module Test

abstract type t (a:Type0) (n:nat) =
  | C: #m:nat -> x:nat{x > m} -> t a n

private let pred (#a:Type0) (#n:nat) (x:t a n) :Type0
  = let C y = x in
    True
aseemr@aseemr-dt1 ~/FStar
$ fstar.exe Test.fst
Unexpected error; please file a bug report, ideally with a minimized version of the source program that triggered the error.
Failure("Not a datacon: C")

The error happens only on the command line (or when this module is checked as a dependency of other modules). Which leads me to believe that it has something to do with exports checking.

Also. changing private to abstract in the definition of pred makes it work. But also note that I am specifically marking the type of pred to Type0, so C should not have escaped in the return type.

I remember one similar issue that I raised before, need to look if this is a duplicate or not. Just noting it down for record.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions