mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-03 23:02:27 +00:00
compiler: process literals in analyzeVoidCalls
Function call can occur in the slice or map literal and its result surely isn't unused.
This commit is contained in:
parent
5f3b8c6d51
commit
fd52dee79f
3 changed files with 34 additions and 0 deletions
|
@ -321,6 +321,15 @@ var sliceTestCases = []testCase{
|
|||
}`,
|
||||
[]byte("string"),
|
||||
},
|
||||
{
|
||||
"literal slice with function call",
|
||||
`package foo
|
||||
func fn() byte { return 't' }
|
||||
func Main() []byte {
|
||||
return []byte{'s', fn(), 'r'}
|
||||
}`,
|
||||
[]byte("str"),
|
||||
},
|
||||
}
|
||||
|
||||
func TestSliceOperations(t *testing.T) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue