Commit f81e4341 authored by Hugo Moreau's avatar Hugo Moreau
Browse files

pass triggering errors for use of struct

parent 119b8b95
package main
import "fmt"
type Vertex struct {
X int
Y int
}
func main() {
fmt.Println(Vertex{1, 2})
}
......@@ -11,6 +11,8 @@ import (
The TypeChecker triggers errors for uses of :
- Non-integer variable
- Channel
- Struct
- Panic
*/
type TypeChecker struct {
......@@ -39,6 +41,9 @@ func (t *TypeChecker) Pre(meta *Meta, v *Visitor) bool {
fmt.Println("Panics are not supported.")
os.Exit(1)
}
case *ast.StructType:
fmt.Println("Structs are not supported.")
os.Exit(1)
case *ast.ChanType:
fmt.Println("Channels are not supported.")
os.Exit(1)
......
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