Project

General

Profile

Revision fc886259 src/types.ml

View differences:

src/types.ml
193 193
  | Tstatic (d, _) -> Some d
194 194
  | _              -> None
195 195

  
196
let rec rename_static rename ty =
197
 match (repr ty).tdesc with
198
 | Tstatic (d, ty') -> { ty with tdesc = Tstatic (Dimension.expr_replace_expr rename d, rename_static rename ty') }
199
 | Tarray  (d, ty') -> { ty with tdesc = Tarray  (Dimension.expr_replace_expr rename d, rename_static rename ty') }
200
 | _                -> ty
201
(*Format.eprintf "Types.rename_static %a = %a@." print_ty ty print_ty res; res*)
202

  
196 203
let get_field_type ty label =
197 204
  match (repr ty).tdesc with
198 205
  | Tstruct fl -> (try Some (List.assoc label fl) with Not_found -> None)
......
254 261
let array_type_dimension ty =
255 262
  match (dynamic_type ty).tdesc with
256 263
  | Tarray (d, _) -> d
257
  | _             -> assert false
264
  | _             -> (Format.eprintf "internal error: Types.array_type_dimension %a@." print_ty ty; assert false)
258 265

  
259 266
let rec array_type_multi_dimension ty =
260 267
  match (dynamic_type ty).tdesc with
......
264 271
let array_element_type ty =
265 272
  match (dynamic_type ty).tdesc with
266 273
  | Tarray (_, ty') -> ty'
267
  | _               -> assert false
274
  | _               -> (Format.eprintf "internal error: Types.array_element_type %a@." print_ty ty; assert false)
268 275

  
269 276
let rec array_base_type ty =
270 277
  let ty = repr ty in

Also available in: Unified diff