Commit 55f21d1d authored by Hugo Moreau's avatar Hugo Moreau
Browse files

pass triggering errors for use of interfaces

parent 40d1ef18
package main
type Shape interface {
Area() int
Perimeter() int
}
......@@ -13,6 +13,8 @@ The TypeChecker triggers errors for uses of :
- Channel
- Struct
- Panic
- Pointer
- Interface
*/
type TypeChecker struct {
......@@ -42,6 +44,9 @@ func (t *TypeChecker) Pre(meta *Meta, v *Visitor) bool {
case *ast.UnaryExpr:
fmt.Println("Pointers are not supported.")
os.Exit(1)
case *ast.InterfaceType:
fmt.Println("Interfaces are not supported.")
os.Exit(1)
case *ast.Ident:
if node.Name == "panic" {
fmt.Println("Panics are not supported.")
......
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