Skip to content

Commit 8cc51b6

Browse files
authored
Merge pull request #1114 from stan-dev/cleanup-signatures
Remove a few redundant signatures
2 parents 6701c66 + 440c44d commit 8cc51b6

5 files changed

Lines changed: 3 additions & 29 deletions

File tree

src/frontend/Canonicalize.ml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@ open Ast
33
open Deprecation_analysis
44

55
type canonicalizer_settings =
6-
{ deprecations: bool
7-
; parentheses: bool
8-
; braces: bool
9-
; (* TODO: NYI. Really for the pretty printer but it makes sense to live here *)
10-
inline_includes: bool }
6+
{deprecations: bool; parentheses: bool; braces: bool; inline_includes: bool}
117

128
let all =
139
{deprecations= true; parentheses= true; inline_includes= true; braces= true}

src/middle/Stan_math_signatures.ml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,7 +1115,6 @@ let () =
11151115
add_unqualified ("distance", ReturnType UReal, [URowVector; URowVector], SoA) ;
11161116
add_unqualified ("distance", ReturnType UReal, [UVector; URowVector], SoA) ;
11171117
add_unqualified ("distance", ReturnType UReal, [URowVector; UVector], SoA) ;
1118-
add_unqualified ("divide", ReturnType UComplex, [UComplex; UReal], AoS) ;
11191118
add_unqualified ("divide", ReturnType UComplex, [UComplex; UComplex], AoS) ;
11201119
add_unqualified ("divide", ReturnType UInt, [UInt; UInt], SoA) ;
11211120
add_unqualified ("divide", ReturnType UReal, [UReal; UReal], SoA) ;
@@ -1668,7 +1667,6 @@ let () =
16681667
("multinomial_logit_rng", ReturnType (UArray UInt), [UVector; UInt], AoS) ;
16691668
add_unqualified
16701669
("multinomial_rng", ReturnType (UArray UInt), [UVector; UInt], AoS) ;
1671-
add_unqualified ("multiply", ReturnType UComplex, [UComplex; UReal], AoS) ;
16721670
add_unqualified ("multiply", ReturnType UComplex, [UComplex; UComplex], AoS) ;
16731671
add_unqualified ("multiply", ReturnType UInt, [UInt; UInt], SoA) ;
16741672
add_unqualified ("multiply", ReturnType UReal, [UReal; UReal], SoA) ;
@@ -2058,15 +2056,8 @@ let () =
20582056
add_unqualified
20592057
("sub_row", ReturnType URowVector, [UMatrix; UInt; UInt; UInt], SoA) ;
20602058
List.iter
2061-
~f:(fun i ->
2062-
add_unqualified
2063-
( "subtract"
2064-
, ReturnType (List.nth_exn bare_types i)
2065-
, [List.nth_exn bare_types i; List.nth_exn bare_types i]
2066-
, SoA ) )
2067-
(List.range 0 bare_types_size) ;
2068-
add_unqualified ("subtract", ReturnType UComplex, [UComplex; UReal], AoS) ;
2069-
add_unqualified ("subtract", ReturnType UComplex, [UComplex; UComplex], AoS) ;
2059+
~f:(fun x -> add_unqualified ("subtract", ReturnType x, [x; x], SoA))
2060+
bare_types ;
20702061
add_unqualified ("subtract", ReturnType UVector, [UVector; UReal], SoA) ;
20712062
add_unqualified ("subtract", ReturnType URowVector, [URowVector; UReal], SoA) ;
20722063
add_unqualified ("subtract", ReturnType UMatrix, [UMatrix; UReal], SoA) ;

test/integration/bad/compound-assign/stanc.expected

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,6 @@ Ill-typed arguments supplied to assignment operator *=: lhs has type row_vector
324324
(real, real) => void
325325
(vector, int) => void
326326
(vector, real) => void
327-
(complex, int) => void
328-
(complex, real) => void
329327
(complex, complex) => void
330328
(row_vector, int) => void
331329
(row_vector, real) => void

test/integration/bad/stanc.expected

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -765,8 +765,6 @@ Ill-typed arguments supplied to infix operator -. Available signatures:
765765
(real, vector) => vector
766766
(vector, real) => vector
767767
(vector, vector) => vector
768-
(complex, real) => complex
769-
(complex, complex) => complex
770768
(complex, complex) => complex
771769
(real, row_vector) => row_vector
772770
(row_vector, real) => row_vector
@@ -1493,7 +1491,6 @@ Ill-typed arguments supplied to infix operator /. Available signatures:
14931491
(int, int) => int
14941492
(real, real) => real
14951493
(vector, real) => vector
1496-
(complex, real) => complex
14971494
(complex, complex) => complex
14981495
(row_vector, real) => row_vector
14991496
(matrix, real) => matrix
@@ -1515,7 +1512,6 @@ Ill-typed arguments supplied to infix operator /. Available signatures:
15151512
(int, int) => int
15161513
(real, real) => real
15171514
(vector, real) => vector
1518-
(complex, real) => complex
15191515
(complex, complex) => complex
15201516
(row_vector, real) => row_vector
15211517
(matrix, real) => matrix
@@ -1691,7 +1687,6 @@ Ill-typed arguments supplied to infix operator *. Available signatures:
16911687
(real, vector) => vector
16921688
(vector, real) => vector
16931689
(matrix, vector) => vector
1694-
(complex, real) => complex
16951690
(complex, complex) => complex
16961691
(real, row_vector) => row_vector
16971692
(row_vector, real) => row_vector
@@ -1717,8 +1712,6 @@ Ill-typed arguments supplied to infix operator -. Available signatures:
17171712
(real, vector) => vector
17181713
(vector, real) => vector
17191714
(vector, vector) => vector
1720-
(complex, real) => complex
1721-
(complex, complex) => complex
17221715
(complex, complex) => complex
17231716
(real, row_vector) => row_vector
17241717
(row_vector, real) => row_vector

test/integration/signatures/stan_math_signatures.t

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3917,7 +3917,6 @@ Display all Stan math signatures exposed in the language
39173917
divide(int, int) => int
39183918
divide(real, real) => real
39193919
divide(vector, real) => vector
3920-
divide(complex, real) => complex
39213920
divide(complex, complex) => complex
39223921
divide(row_vector, real) => row_vector
39233922
divide(matrix, real) => matrix
@@ -14517,7 +14516,6 @@ Display all Stan math signatures exposed in the language
1451714516
multiply(real, vector) => vector
1451814517
multiply(vector, real) => vector
1451914518
multiply(matrix, vector) => vector
14520-
multiply(complex, real) => complex
1452114519
multiply(complex, complex) => complex
1452214520
multiply(real, row_vector) => row_vector
1452314521
multiply(row_vector, real) => row_vector
@@ -26164,8 +26162,6 @@ Display all Stan math signatures exposed in the language
2616426162
subtract(real, vector) => vector
2616526163
subtract(vector, real) => vector
2616626164
subtract(vector, vector) => vector
26167-
subtract(complex, real) => complex
26168-
subtract(complex, complex) => complex
2616926165
subtract(complex, complex) => complex
2617026166
subtract(real, row_vector) => row_vector
2617126167
subtract(row_vector, real) => row_vector

0 commit comments

Comments
 (0)