Changeset 2740:31105c1fc01d

Show
Ignore:
Timestamp:
01/17/11 09:56:09 (16 months ago)
Author:
Wenceslas Godard <wenceslas.godard(at)eads.net>
Children:
2741:eda78acc6b56, 2746:357c8beeaf55
Branch:
default
Tags:
delivery-airbus-110117
Message:

typing info for translating the case expression (t466)

Files:
2 added
2 modified

Legend:

Unmodified
Added
Removed
  • src/ada2newspeak/normalize.ml

    r2739 r2740  
    16221622  | Exit -> [Ast.Exit, loc] 
    16231623  | Case (e, choices, default) -> 
    1624             [Ast.Case (normalize_exp e, 
    1625                   List.map (fun (e,block) -> 
    1626                               normalize_exp e, 
    1627                               normalize_block ?return_type block) 
    1628                       choices, 
    1629                   Ada_utils.may (fun x -> normalize_block ?return_type x) 
    1630                                 default 
    1631                   ),loc] 
     1624      let case_exp = normalize_exp e in 
     1625      let (_, case_t) = case_exp in  
     1626        [Ast.Case (case_exp , 
     1627                   List.map (fun (e,block) -> 
     1628                               normalize_exp e ~expected_type:case_t, 
     1629                               normalize_block ?return_type block) 
     1630                     choices, 
     1631                   Ada_utils.may (fun x -> normalize_block ?return_type x) 
     1632                     default 
     1633                  ),loc 
     1634        ] 
    16321635  | Block (dp,blk) ->  
    16331636      Sym.enter_context ~desc:"Declare block" gtbl; 
  • tests/ada2newspeak/Makefile

    r2739 r2740  
    7070      t441      t444  t447  t449 t450 \ 
    7171      t454 t455 t456 t457 t458 t459 t460 \ 
    72       t461 t462 t463 t464 t465 
     72      t461 t462 t463 t464 t465 t466 
    7373 
    7474include ../common.Makefile