Add test for ExtractTupleElementInstruction.getResultType()

This commit is contained in:
Chris Smowton
2021-04-21 12:33:51 +01:00
parent 4fb714f445
commit a152eec9f2
3 changed files with 33 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
| test.go:9:2:9:16 | ... := ...[0] | bool |
| test.go:9:2:9:16 | ... := ...[1] | bool |
| test.go:15:2:15:20 | ... := ...[0] | string |
| test.go:15:2:15:20 | ... := ...[1] | bool |
| test.go:21:2:21:22 | ... := ...[0] | string |
| test.go:21:2:21:22 | ... := ...[1] | bool |

View File

@@ -0,0 +1,23 @@
package test
import (
"fmt"
)
func testChannel() {
var ch chan bool
got, ok := <-ch
fmt.Printf("%v %v", got, ok)
}
func testMap() {
var m map[string]string
got, ok := m["key"]
fmt.Printf("%v %v", got, ok)
}
func testTypeAssert() {
var i interface{}
got, ok := i.(string)
fmt.Printf("%v %v", got, ok)
}

View File

@@ -0,0 +1,4 @@
import go
from IR::ExtractTupleElementInstruction extract
select extract, extract.getResultType()