Comments (6)
There is no non-determinism in the gospel
tool. Maybe the command gospel check
is misleading there: it performs type-checking. Actually checking the specifications is left for other tools.
Said another way, encountering an object type (or any other unsupported type) will trigger the assert false
reported in the error message.
from gospel.
I was trying to re-create this issue : reproducible repo.
And I was getting no errors with it, what am I doing wrong here πΊ ?
I got an error, wasn't using the gospel cli π€¦
test_gospel on ξ main via π« v4.13.1 (4.13.1+options) on β (ap-southeast-2)
β― gospel check bin/main.mli
gospel: internal error, uncaught exception:
File "src/typing.ml", line 108, characters 9-15: Assertion failed
main.ml
class test_obj =
object (_self)
val mutable i = 1
method bob = i
end
let ret_obj () =
object
val mutable i = 0
method bob = i
end
and respective .mli file
class test_obj :
object
val mutable i : int
method bob : int
end
val ret_obj : unit -> <bob:int>
(*@ o = ret_obj () *)
output
test_gospel on ξ main via π« v4.13.1 (4.13.1+options) on β (ap-southeast-2) took 3s
β― dune build bin/main.exe
test_gospel on ξ main via π« v4.13.1 (4.13.1+options) on β (ap-southeast-2)
β― dune exec bin/main.exe
Thanks!
from gospel.
I might not be well versed in what the exact error should look like but I imagine this kind of error is an non-deterministic error, right?
The output can never depend on input, very similar to any function which has side effects we cannot determine what kind implementation is performed by the user and the int value returned can be anything similar to a read_line
function
I am afraid I might be conceptually wrong about this, please let me know
from gospel.
Thanks for the correction, I am not well versed with model checking but I am interested in it.
So according to your explanation the type checking matching leads to classify objects as an unsupported type which leads to pattern matching the error with _ -> assert false
The solution to this off the top of my head would be address the object type as a valid type in the typechecker and then add another error type constructor in warnings.ml
-> type kind
.
This would lead to a clearer type error. Am I on the right track here.
Btw thanks for the quick reply @shym π
from gospel.
The solution to this off the top of my head would be address the object type as a valid type in the typechecker and then add another error type constructor in
warnings.ml
->type kind
.
It depends on what you mean by βvalid typeβ: we donβt want to bring support for objects in Gospel (that would be quite some work!), but just end up with a new error indeed.
from gospel.
Fixed by #406
from gospel.
Related Issues (20)
- Make the Gospel type-checker modular HOT 4
- Simplify attribute nesting
- Revise xposts internal representation HOT 1
- Revise Identifier implementation HOT 2
- The PNG in the readme is out of date syntax-wise HOT 2
- Should the type-checker force returned tuples to be destructed?
- Values of type `unit` are named `unit`
- Uncaught exception on mutually recursive ghost types
- How should gospel handle model names? HOT 1
- Pre-processor bug HOT 2
- Too much ghost keywords?
- Bad pattern-matching analysis for tuple
- Inlined records as variant's argument are seen as unnamed tuples HOT 1
- Type-checker fails with an assert false on extensible type
- Update record fails with irrelevant error
- Make identifiers include the relative path.
- Remove attributes from identifiers
- Make `dumpast` less verbose
- Records with partially same fields name
- Incomplete record pattern don't use OCaml syntax
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gospel.