Skip to content

Commit

Permalink
Fix issues for engine
Browse files Browse the repository at this point in the history
  • Loading branch information
hellovai committed Nov 24, 2023
1 parent a18457d commit 374f48a
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 24 deletions.
39 changes: 20 additions & 19 deletions engine/baml-lib/baml/tests/validation_files/class/secure_types.baml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ class ComplexTypes {



// error: Type `apple_pie` does not exist.

// error: Type `apple_pie` does not exist. Did you mean one of these: `ComplexTypes`, `float`, `bool`, `string`, `int`?
// --> class/secure_types.baml:3
// |
// 2 | class ComplexTypes {
Expand All @@ -41,19 +42,19 @@ class ComplexTypes {
// 4 | b (int, {bool: string?}, (char | float)[][] | long_word_123.foobar[])
// 5 | c apple123_456_pie | (stringer, bool[], (int | char))[]
// |
// error: Type `stringer` does not exist. Did you mean `string`?
// error: Type `stringer` does not exist. Did you mean one of these: `string`, `int`, `float`, `bool`?
// --> class/secure_types.baml:5
// |
// 4 | b (int, {bool: string?}, (char | float)[][] | long_word_123.foobar[])
// 5 | c apple123_456_pie | (stringer, bool[], (int | char))[]
// |
// error: Type `double` does not exist.
// error: Type `double` does not exist. Did you mean one of these: `bool`, `string`, `int`, `float`, `ComplexTypes`?
// --> class/secure_types.baml:7
// |
// 6 | d {int[][]: ((int | float) | char[])}
// 7 | e ((int, string | char) | ((float, double) | long[], bool)[][][])
// |
// error: Type `long` does not exist.
// error: Type `long` does not exist. Did you mean one of these: `int`, `float`, `bool`, `string`?
// --> class/secure_types.baml:7
// |
// 6 | d {int[][]: ((int | float) | char[])}
Expand All @@ -71,25 +72,25 @@ class ComplexTypes {
// 8 | f VeryLongWord_With_123_Numbers[][][][]
// 9 | g (int, (float, char, bool), string[]) | tuple_inside_tuple[]
// |
// error: Type `apple` does not exist.
// error: Type `apple` does not exist. Did you mean one of these: `bool`, `int`, `float`, `string`, `ComplexTypes`?
// --> class/secure_types.baml:11
// |
// 10 | h (((int | string)[]) | {bool[][]: char[]})
// 11 | i (apple, banana | cherry | date_fruit | eggplant_vegetable)[]
// |
// error: Type `banana` does not exist.
// error: Type `banana` does not exist. Did you mean one of these: `string`, `int`, `float`, `bool`?
// --> class/secure_types.baml:11
// |
// 10 | h (((int | string)[]) | {bool[][]: char[]})
// 11 | i (apple, banana | cherry | date_fruit | eggplant_vegetable)[]
// |
// error: Type `cherry` does not exist.
// error: Type `cherry` does not exist. Did you mean one of these: `string`, `int`, `float`, `bool`, `ComplexTypes`?
// --> class/secure_types.baml:11
// |
// 10 | h (((int | string)[]) | {bool[][]: char[]})
// 11 | i (apple, banana | cherry | date_fruit | eggplant_vegetable)[]
// |
// error: Type `date_fruit` does not exist.
// error: Type `date_fruit` does not exist. Did you mean one of these: `string`, `float`, `int`, `bool`?
// --> class/secure_types.baml:11
// |
// 10 | h (((int | string)[]) | {bool[][]: char[]})
Expand All @@ -101,19 +102,19 @@ class ComplexTypes {
// 10 | h (((int | string)[]) | {bool[][]: char[]})
// 11 | i (apple, banana | cherry | date_fruit | eggplant_vegetable)[]
// |
// error: Type `double` does not exist.
// error: Type `double` does not exist. Did you mean one of these: `bool`, `string`, `int`, `float`, `ComplexTypes`?
// --> class/secure_types.baml:12
// |
// 11 | i (apple, banana | cherry | date_fruit | eggplant_vegetable)[]
// 12 | j ((char, int[][], (bool | string[][])) | double[][][][], (float, int)[])
// |
// error: Type `long` does not exist.
// error: Type `long` does not exist. Did you mean one of these: `int`, `float`, `bool`, `string`?
// --> class/secure_types.baml:13
// |
// 12 | j ((char, int[][], (bool | string[][])) | double[][][][], (float, int)[])
// 13 | k {string[]: (int | long[])} | {float[][]: double[][]}
// |
// error: Type `double` does not exist.
// error: Type `double` does not exist. Did you mean one of these: `bool`, `string`, `int`, `float`, `ComplexTypes`?
// --> class/secure_types.baml:13
// |
// 12 | j ((char, int[][], (bool | string[][])) | double[][][][], (float, int)[])
Expand All @@ -125,49 +126,49 @@ class ComplexTypes {
// 13 | k {string[]: (int | long[])} | {float[][]: double[][]}
// 14 | l AlphaNumeric_123_456_789 | (int, bool?) | char[]
// |
// error: Type `tuple_1` does not exist.
// error: Type `tuple_1` does not exist. Did you mean one of these: `float`, `bool`, `string`, `int`, `ComplexTypes`?
// --> class/secure_types.baml:15
// |
// 14 | l AlphaNumeric_123_456_789 | (int, bool?) | char[]
// 15 | m (tuple_1, tuple_2 | tuple_3, (tuple_4, tuple_5))[]
// |
// error: Type `tuple_2` does not exist.
// error: Type `tuple_2` does not exist. Did you mean one of these: `float`, `bool`, `string`, `int`, `ComplexTypes`?
// --> class/secure_types.baml:15
// |
// 14 | l AlphaNumeric_123_456_789 | (int, bool?) | char[]
// 15 | m (tuple_1, tuple_2 | tuple_3, (tuple_4, tuple_5))[]
// |
// error: Type `tuple_3` does not exist.
// error: Type `tuple_3` does not exist. Did you mean one of these: `float`, `bool`, `string`, `int`, `ComplexTypes`?
// --> class/secure_types.baml:15
// |
// 14 | l AlphaNumeric_123_456_789 | (int, bool?) | char[]
// 15 | m (tuple_1, tuple_2 | tuple_3, (tuple_4, tuple_5))[]
// |
// error: Type `tuple_4` does not exist.
// error: Type `tuple_4` does not exist. Did you mean one of these: `float`, `bool`, `string`, `int`, `ComplexTypes`?
// --> class/secure_types.baml:15
// |
// 14 | l AlphaNumeric_123_456_789 | (int, bool?) | char[]
// 15 | m (tuple_1, tuple_2 | tuple_3, (tuple_4, tuple_5))[]
// |
// error: Type `tuple_5` does not exist.
// error: Type `tuple_5` does not exist. Did you mean one of these: `float`, `bool`, `string`, `int`, `ComplexTypes`?
// --> class/secure_types.baml:15
// |
// 14 | l AlphaNumeric_123_456_789 | (int, bool?) | char[]
// 15 | m (tuple_1, tuple_2 | tuple_3, (tuple_4, tuple_5))[]
// |
// error: Type `another_key` does not exist.
// error: Type `another_key` does not exist. Did you mean one of these: `string`, `int`, `ComplexTypes`, `float`, `bool`?
// --> class/secure_types.baml:16
// |
// 15 | m (tuple_1, tuple_2 | tuple_3, (tuple_4, tuple_5))[]
// 16 | n {complex_key_type[]: {another_key: (int | string[])}}
// |
// error: Type `complex_key_type` does not exist.
// error: Type `complex_key_type` does not exist. Did you mean `ComplexTypes`?
// --> class/secure_types.baml:16
// |
// 15 | m (tuple_1, tuple_2 | tuple_3, (tuple_4, tuple_5))[]
// 16 | n {complex_key_type[]: {another_key: (int | string[])}}
// |
// error: Type `double` does not exist.
// error: Type `double` does not exist. Did you mean one of these: `bool`, `string`, `int`, `float`, `ComplexTypes`?
// --> class/secure_types.baml:17
// |
// 16 | n {complex_key_type[]: {another_key: (int | string[])}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ class InterfaceOne {



// error: Type `strin` does not exist. Did you mean `string`?

// error: Type `strin` does not exist. Did you mean one of these: `string`, `int`, `float`, `bool`, `InterfaceOne`, `InterfaceTwo`?
// --> class/spelling_error.baml:2
// |
// 1 | class InterfaceTwo {
// 2 | interface strin
// |
// error: Type `InterfaceT` does not exist. Did you mean `InterfaceTwo`?
// error: Type `InterfaceT` does not exist. Did you mean one of these: `InterfaceTwo`, `InterfaceOne`, `int`, `string`, `float`, `bool`?
// --> class/spelling_error.baml:6
// |
// 5 | class InterfaceOne {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ class InterfaceTwo {



// error: Type `Bar` does not exist.

// error: Type `Bar` does not exist. Did you mean one of these: `int`, `bool`, `float`, `string`?
// --> class/unknown_type.baml:3
// |
// 2 | interface string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ function Foo {



// error: Type `Bar` does not exist.

// error: Type `Bar` does not exist. Did you mean one of these: `int`, `bool`, `float`, `string`?
// --> functions/nonexistent_input_output_types.baml:3
// |
// 2 | function Foo {
// 3 | input Bar
// |
// error: Type `Baz` does not exist.
// error: Type `Baz` does not exist. Did you mean one of these: `int`, `bool`, `float`, `string`?
// --> functions/nonexistent_input_output_types.baml:4
// |
// 3 | input Bar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,10 @@ function ExtractAllergies {
input (hello: string, world: string)
output Allergies[]
}

// error: Type `Allergies` does not exist. Did you mean one of these: `string`, `Bar`, `int`, `float`, `bool`?
// --> functions/valid_multiple_arg.baml:12
// |
// 11 | input (hello: string, world: string)
// 12 | output Allergies[]
// |

0 comments on commit 374f48a

Please sign in to comment.