Implement global interface variable constant

This commit is contained in:
Ayke van Laethem
2018-08-25 02:58:00 +02:00
parent c25b448758
commit 9f2bcfe5e3
3 changed files with 39 additions and 3 deletions
+7
View File
@@ -224,6 +224,8 @@ func (p *Program) getZeroValue(t types.Type) (Value, error) {
return &ArrayValue{typ.Elem(), elems}, nil
case *types.Basic:
return &ZeroBasicValue{typ}, nil
case *types.Interface:
return &InterfaceValue{typ}, nil
case *types.Pointer:
return &PointerValue{nil}, nil
case *types.Struct:
@@ -259,6 +261,11 @@ type PointerValue struct {
Elem *Value
}
type InterfaceValue struct {
Type *types.Interface
//Elem Value
}
type PointerBitCastValue struct {
Type types.Type
Elem Value