You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 5728 Reporter: furuse Status: closed (set by @mshinwell on 2016-12-07T13:41:20Z) Resolution: won't fix Priority: normal Severity: feature Version: 4.00.0 Category: ~DO NOT USE (was: OCaml general) Related to:#5811
Bug description
Playing with compiler-libs, I found that it is now rather easy to create an unary tuple value Parsetree node and it is typable with a strange unary tuple type.
Of course it is the user's responsibility not to create such strange AST nodes, but I think the compiler can provide some help by explicitly rejecting the typing of unary tuples.
BTW, the type error message related with this unary tuple type looks very cryptic:
Error: This expression has type 'a but an expression was expected of type
string
Here 'a is not a simple Tvar but something to be printed like Tuple('a), which is not unifiable with string.
The text was updated successfully, but these errors were encountered:
I think it is unfortunately the programmer's responsibility to get this sort of thing right. There has been some suggestion of trying to write a better interface to Parsetree (in particular for the purposes of increasing the maintainability of ppx code). This sort of thing could probably be cleaned up at the same time.
Original bug ID: 5728
Reporter: furuse
Status: closed (set by @mshinwell on 2016-12-07T13:41:20Z)
Resolution: won't fix
Priority: normal
Severity: feature
Version: 4.00.0
Category: ~DO NOT USE (was: OCaml general)
Related to: #5811
Bug description
Playing with compiler-libs, I found that it is now rather easy to create an unary tuple value Parsetree node and it is typable with a strange unary tuple type.
Of course it is the user's responsibility not to create such strange AST nodes, but I think the compiler can provide some help by explicitly rejecting the typing of unary tuples.
BTW, the type error message related with this unary tuple type looks very cryptic:
Error: This expression has type 'a but an expression was expected of type
string
Here 'a is not a simple Tvar but something to be printed like Tuple('a), which is not unifiable with string.
The text was updated successfully, but these errors were encountered: