Soilihi BEN SOILIHI BOINA pushed to branch add-proj at Stefan / Typer
Commits: ec783568 by Soilih BEN SOILIH at 2021-12-21T00:47:24-05:00 fixing...
- - - - -
1 changed file:
- src/opslexp.ml
Changes:
===================================== src/opslexp.ml ===================================== @@ -765,15 +765,16 @@ and check'' erased ctx e = | _,_ -> (log_tc_error ~loc:l "Wrong arg number to inductive type!"; s) in let s = mksubst S.identity fargs aargs in - let fieldtypes = SMap.find label constructors in + let (_,fieldtypes) = List.hd (SMap.bindings constructors) in let rec getfieldtype s (fieldtypes : (arg_kind * vname * ltype) list) = match fieldtypes with | [] -> log_tc_error ~loc:l "Tuple has no field named: %s" label; etype | (ak, (_, Some fn), ftype)::_ when fn = label (* We found our field! *) - -> if ak = Aerasable + -> mkSusp ftype s + (*if ak = Aerasable then mkSusp ftype s (* Yay! We found our field! *) - else (log_tc_error ~loc:l "Can't Proj an erasale field: %s" label; etype) + else (log_tc_error ~loc:l "Can't Proj an erasale field: %s" label; etype)*) | (ak, vdef, ftype)::fieldtypes -> let fvdef vdef e loc lbl = match vdef with @@ -1073,15 +1074,16 @@ and get_type ctx e = | _,_ -> (log_tc_error ~loc:l "Wrong arg number to inductive type!"; s) in let s = mksubst S.identity fargs aargs in - let fieldtypes = SMap.find label constructors in + let (_,fieldtypes) = List.hd (SMap.bindings constructors) in let rec getfieldtype s (fieldtypes : (arg_kind * vname * ltype) list) = match fieldtypes with | [] -> log_tc_error ~loc:l "Tuple has no field named: %s" label; etype | (ak, (_, Some fn), ftype)::_ when fn = label (* We found our field! *) - -> if ak = Aerasable + -> mkSusp ftype s + (*if ak = Aerasable then mkSusp ftype s (* Yay! We found our field! *) - else (log_tc_error ~loc:l "Can't Proj an erasale field: %s" label; etype) + else (log_tc_error ~loc:l "Can't Proj an erasale field: %s" label; etype)*) | (ak, vdef, ftype)::fieldtypes -> let fvdef vdef e loc lbl = match vdef with
View it on GitLab: https://gitlab.com/monnier/typer/-/commit/ec783568fd4831a158f2c0dc0afa836ef3...
Afficher les réponses par date