Commit 8c193c76 authored by Hugo Moreau's avatar Hugo Moreau
Browse files

pass triggering errors for use of switch

parent 2549b1bb
package main
import (
"fmt"
"time"
)
func main() {
tick := time.Tick(100 * time.Millisecond)
boom := time.After(500 * time.Millisecond)
for {
select {
case <-tick:
fmt.Println("tick.")
case <-boom:
fmt.Println("BOOM!")
return
default:
fmt.Println(" .")
time.Sleep(50 * time.Millisecond)
}
}
}
......@@ -16,6 +16,8 @@ The TypeChecker triggers errors for uses of :
- Pointer
- Interface
- Map
- Switch
- Select
*/
type TypeChecker struct {
......@@ -65,6 +67,9 @@ func (t *TypeChecker) Pre(meta *Meta, v *Visitor) bool {
case *ast.SwitchStmt:
fmt.Println("Switch are not supported.")
os.Exit(1)
case *ast.SelectorExpr:
fmt.Println("Select are not supported.")
os.Exit(1)
}
return true
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment