Skip to content

Commit 225669f

Browse files
committed
Cleanup
1 parent 0a25b5a commit 225669f

4 files changed

Lines changed: 12 additions & 3 deletions

File tree

src/frontend/Promotion.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module UnsizedType = Middle.UnsizedType
44

55
(** Type to represent promotions in the typechecker.
66
This can be used to return information about how to promote
7-
expressions for use in [Ast.Promotion]*)
7+
expressions for use in [Ast.Promotion] *)
88
type t =
99
| NoPromotion
1010
| IntToReal

src/frontend/Typechecker.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -978,9 +978,9 @@ let check_assignment loc cf tenv assign_lhs assign_op assign_rhs =
978978
|> error in
979979
verify_assignment_global loc cf block global assign_id ;
980980
verify_assignment_read_only loc readonly assign_id ;
981-
let rhs = check_assignment_operator loc assign_op lhs rhs in
981+
let rhs' = check_assignment_operator loc assign_op lhs rhs in
982982
mk_typed_statement ~return_type:NoReturnType ~loc
983-
~stmt:(Assignment {assign_lhs= lhs; assign_op; assign_rhs= rhs})
983+
~stmt:(Assignment {assign_lhs= lhs; assign_op; assign_rhs= rhs'})
984984

985985
(* target plus-equals / increment log-prob *)
986986

test/integration/good/promotion/array_promotion.stan

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,16 @@ data {
1616
array[N] int xs;
1717
}
1818

19+
parameters {
20+
real r;
21+
}
22+
1923
transformed parameters {
2024
array[2,2] real zs = {{2,3},{7,0.5}};
2125
array[2] complex z1 = {1,3};
2226
array[2] complex z2 = {1,3.5};
2327
array[2] complex z3 = {1,3.5i};
28+
z3 = {3.5i, r};
2429
}
2530

2631
model {

test/integration/good/promotion/pretty.expected

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,15 @@ data {
3030
int N;
3131
array[N] int xs;
3232
}
33+
parameters {
34+
real r;
35+
}
3336
transformed parameters {
3437
array[2, 2] real zs = {{2, 3}, {7, 0.5}};
3538
array[2] complex z1 = {1, 3};
3639
array[2] complex z2 = {1, 3.5};
3740
array[2] complex z3 = {1, 3.5i};
41+
z3 = {3.5i, r};
3842
}
3943
model {
4044
array[3] int d = {1, 2, 3};

0 commit comments

Comments
 (0)