Skip to content

Commit

Permalink
[fix] compiler, database, mongo: embedded path of embedded map
Browse files Browse the repository at this point in the history
  • Loading branch information
BourgerieQuentin committed May 23, 2012
1 parent bb01c2c commit f79c8db
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
9 changes: 5 additions & 4 deletions libqmlcompil/qmlDbGen.ml
Expand Up @@ -365,10 +365,11 @@ module Utils = struct

let rec type_of_selected gamma ty select =
let traverse_map s =
begin match QmlTypesUtils.Inspect.follow_alias_noopt_private ~until:"ordered_map" gamma ty with
| QmlAst.TypeName ([_; dty; _], _) -> type_of_selected gamma dty s
| ty2 -> OManager.i_error "Try to select an id on %a %a" QmlPrint.pp#ty ty QmlPrint.pp#ty ty2
end
type_of_selected gamma (
try QmlTypesUtils.Inspect.get_data_type_of_map gamma ty with
| Not_found ->
OManager.i_error "Try to select an id on %a" QmlPrint.pp#ty ty
) s
in
let res = match select with
| DbAst.SNil | DbAst.SStar | DbAst.SSlice _ -> ty
Expand Down
7 changes: 6 additions & 1 deletion opa/pass_MongoAccessGeneration.ml
Expand Up @@ -838,7 +838,12 @@ module Generator = struct
| DbAst.Query (DbAst.QEq uexpr , _)->
DbAst.SId (uexpr, select),
(fun (annotmap, expr) -> post (annotmap, expr)),
(fun dty -> posty dty),
(fun dty ->
try posty (QmlTypesUtils.Inspect.get_data_type_of_map gamma dty) with
| Not_found ->
QmlError.i_error None context
"Try to select an id on %a" QmlPrint.pp#ty dty
),
`expr uexpr::embed_field
| DbAst.NewKey _
| DbAst.Query _ ->
Expand Down

0 comments on commit f79c8db

Please sign in to comment.