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: 6264 Reporter: yann.regis-gianas Assigned to:@gasche Status: closed (set by @xavierleroy on 2015-12-11T18:25:26Z) Resolution: duplicate Priority: normal Severity: minor Version: 4.01.0 Category: typing Duplicate of:#6150
Bug description
The following program is rejected by the type-checker with a strange error message. Replacing 'a by _ make the type-checker happy. Is it a bug or a hard-to-explain restriction of the inference algorithm?
? src git:(master) ? ocaml
OCaml version 4.01.0
let f : type a. a -> int = fun x -> let y : 'a = x in 0;;
Characters 49-50:
let f : type a. a -> int = fun x -> let y : 'a = x in 0;;
^
Error: This expression has type a but an expression was expected of type a
The type constructor a would escape its scope
Steps to reproduce
Run ocaml 4.01.0 on the following phrase:
let f : type a. a -> int = fun x -> let y : 'a = x in 0;;
The text was updated successfully, but these errors were encountered:
Original bug ID: 6264
Reporter: yann.regis-gianas
Assigned to: @gasche
Status: closed (set by @xavierleroy on 2015-12-11T18:25:26Z)
Resolution: duplicate
Priority: normal
Severity: minor
Version: 4.01.0
Category: typing
Duplicate of: #6150
Bug description
The following program is rejected by the type-checker with a strange error message. Replacing 'a by _ make the type-checker happy. Is it a bug or a hard-to-explain restriction of the inference algorithm?
? src git:(master) ? ocaml
OCaml version 4.01.0
let f : type a. a -> int = fun x -> let y : 'a = x in 0;;
Characters 49-50:
let f : type a. a -> int = fun x -> let y : 'a = x in 0;;
^
Error: This expression has type a but an expression was expected of type a
The type constructor a would escape its scope
Steps to reproduce
Run ocaml 4.01.0 on the following phrase:
let f : type a. a -> int = fun x -> let y : 'a = x in 0;;
The text was updated successfully, but these errors were encountered: