Skip to content

Commit

Permalink
Fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
heshanpadmasiri committed Oct 28, 2024
1 parent a099fce commit b39af2b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/raw-templates/raw_templates.bal
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ public function main() {
int col1 = 5;
int col2 = 10;

// No static type validation for interpolation
// Allow any value as interpolations since object:RawTemplate has any|error[] as insertions type.
object:RawTemplate rawTemplate = `${col1}, fixed_string1, ${col2}, ${col3()}, fixed_string3`;
io:println(rawTemplate.strings);
io:println(rawTemplate.insertions);

// validate interpolations at compile time
// Ensure we have 2 ints fallowed by a boolean value as interpolations based on insertions type.
MyCSVRawTemplate myCSVRawTemplate = `fixed_string4, ${col1}, ${col2}, fixed_string_5, ${col3()}`;
io:println(myCSVRawTemplate.strings);
io:println(myCSVRawTemplate.insertions);
Expand Down

0 comments on commit b39af2b

Please sign in to comment.