Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
builtin, cgen: fix printing slice of fn call string (#19450)
- Loading branch information
Showing
5 changed files
with
26 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Get called | ||
ello |
15 changes: 15 additions & 0 deletions
15
vlib/v/slow_tests/inout/printing_slice_of_fn_call_string.vv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
struct Wrapper { | ||
element string | ||
} | ||
|
||
fn (instance Wrapper) get() string { | ||
println("Get called") | ||
return instance.element | ||
} | ||
|
||
fn main() { | ||
wrapper := Wrapper{ | ||
element: "Hello" | ||
} | ||
println(wrapper.get()[1..]) | ||
} |