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: 6672 Reporter:@lpw25 Assigned to:@garrigue Status: closed (set by @xavierleroy on 2016-12-07T10:47:37Z) Resolution: fixed Priority: normal Severity: minor Version: 4.03.0+dev / +beta1 Target version: 4.02.3+dev Fixed in version: 4.03.0+dev / +beta1 Category: ~DO NOT USE (was: OCaml general)
Bug description
Destructive type substitutions can give a variance specification to their parameters, but it is completely ignored and not even checked for correctness:
# module type S = sig type 'a t val x : int t end;;
module type S = sig type 'a t val x : int t end
# module type T = S with type +'a t := 'a list;;
module type T = sig val x : int list end
# module type T = S with type -'a t := 'a list;;
module type T = sig val x : int list end
The text was updated successfully, but these errors were encountered:
It seems the same is true for non-destructive type substitution:
# module type S = sig type 'a t end;;
module type S = sig type 'a t end
# module type T = S with type +'a t = 'a list;;
module type T = sig type 'a t = 'a list end
# module type T = S with type -'a t = 'a list;;
module type T = sig type 'a t = 'a list end
I suggest that the variance annotations are either checked (by setting the check parameter of compute_variance_decl to true in transl_with_constraint) or banned by the parser.
Original bug ID: 6672
Reporter: @lpw25
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2016-12-07T10:47:37Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.03.0+dev / +beta1
Target version: 4.02.3+dev
Fixed in version: 4.03.0+dev / +beta1
Category: ~DO NOT USE (was: OCaml general)
Bug description
Destructive type substitutions can give a variance specification to their parameters, but it is completely ignored and not even checked for correctness:
The text was updated successfully, but these errors were encountered: