Documentation
¶
Index ¶
- func Contract2String(c Contract) string
- func UnmarshalTypevar(rawMessage *json.RawMessage) (typevars.Interface, error)
- type BinaryOp
- type Contract
- type DereferenceOf
- type HasField
- type IsCompatibleWith
- type IsDereferenceable
- type IsIncDecable
- type IsIndexable
- type IsInvocable
- type IsRangeable
- type IsReceiveableFrom
- type IsReferenceable
- type IsSendableTo
- type PropagatesTo
- type ReferenceOf
- type Type
- type TypecastsTo
- type UnaryOp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contract2String ¶
func UnmarshalTypevar ¶
func UnmarshalTypevar(rawMessage *json.RawMessage) (typevars.Interface, error)
Types ¶
type BinaryOp ¶
type BinaryOp struct { // OpToken gives information about particular binary operation. // E.g. '+' can be used with integers and strings, '-' can not be used with strings. // As long as the operands are compatible with the operation, the contract holds. OpToken token.Token `json:"optoken"` // Z = X op Y X typevars.Interface `json:"x"` Y typevars.Interface `json:"y"` Z typevars.Interface `json:"z"` ExpectedType gotypes.DataType `json:"expectedtype"` Pos string `json:"pos"` }
BinaryOp represents contract between two typevars
func (*BinaryOp) MarshalJSON ¶
func (*BinaryOp) UnmarshalJSON ¶
type DereferenceOf ¶
type DereferenceOf struct { X typevars.Interface `json:"x"` Y typevars.Interface `json:"y"` Pos string `json:"pos"` }
func (*DereferenceOf) GetType ¶
func (i *DereferenceOf) GetType() Type
func (*DereferenceOf) MarshalJSON ¶
func (o *DereferenceOf) MarshalJSON() (b []byte, e error)
func (*DereferenceOf) UnmarshalJSON ¶
func (o *DereferenceOf) UnmarshalJSON(b []byte) error
type HasField ¶
type HasField struct { X typevars.Interface `json:"x"` Field string `json:"field"` Index int `json:"index"` Pos string `json:"pos"` }
func (*HasField) MarshalJSON ¶
func (*HasField) UnmarshalJSON ¶
type IsCompatibleWith ¶
type IsCompatibleWith struct { X typevars.Interface `json:"x"` Y typevars.Interface `json:"y"` ExpectedType gotypes.DataType `json:"expectedtype"` // As long as MapKey is compatible with integer, it is compatible with ListKey as well // TODO(jchaloup): make sure this principle is applied during the compatibility analysis Weak bool `json:"weak"` Pos string `json:"pos"` }
func (*IsCompatibleWith) GetType ¶
func (i *IsCompatibleWith) GetType() Type
func (*IsCompatibleWith) MarshalJSON ¶
func (o *IsCompatibleWith) MarshalJSON() (b []byte, e error)
func (*IsCompatibleWith) UnmarshalJSON ¶
func (o *IsCompatibleWith) UnmarshalJSON(b []byte) error
type IsDereferenceable ¶
func (*IsDereferenceable) GetType ¶
func (i *IsDereferenceable) GetType() Type
func (*IsDereferenceable) MarshalJSON ¶
func (o *IsDereferenceable) MarshalJSON() (b []byte, e error)
func (*IsDereferenceable) UnmarshalJSON ¶
func (o *IsDereferenceable) UnmarshalJSON(b []byte) error
type IsIncDecable ¶
func (*IsIncDecable) GetType ¶
func (i *IsIncDecable) GetType() Type
func (*IsIncDecable) MarshalJSON ¶
func (o *IsIncDecable) MarshalJSON() (b []byte, e error)
func (*IsIncDecable) UnmarshalJSON ¶
func (o *IsIncDecable) UnmarshalJSON(b []byte) error
type IsIndexable ¶
type IsIndexable struct { X typevars.Interface `json:"x"` Key typevars.Interface `json:"key"` IsSlice bool `json:"isslice"` Pos string `json:"pos"` }
func (*IsIndexable) GetType ¶
func (i *IsIndexable) GetType() Type
func (*IsIndexable) MarshalJSON ¶
func (o *IsIndexable) MarshalJSON() (b []byte, e error)
func (*IsIndexable) UnmarshalJSON ¶
func (o *IsIndexable) UnmarshalJSON(b []byte) error
type IsInvocable ¶
type IsInvocable struct { F typevars.Interface `json:"f"` ArgsCount int `json:"argscount"` Pos string `json:"pos"` }
func (*IsInvocable) GetType ¶
func (i *IsInvocable) GetType() Type
func (*IsInvocable) MarshalJSON ¶
func (o *IsInvocable) MarshalJSON() (b []byte, e error)
func (*IsInvocable) UnmarshalJSON ¶
func (o *IsInvocable) UnmarshalJSON(b []byte) error
type IsRangeable ¶
func (*IsRangeable) GetType ¶
func (i *IsRangeable) GetType() Type
func (*IsRangeable) MarshalJSON ¶
func (o *IsRangeable) MarshalJSON() (b []byte, e error)
func (*IsRangeable) UnmarshalJSON ¶
func (o *IsRangeable) UnmarshalJSON(b []byte) error
type IsReceiveableFrom ¶
type IsReceiveableFrom struct { X typevars.Interface `json:"x"` Y typevars.Interface `json:"y"` ExpectedType gotypes.DataType `json:"expectedtype"` Pos string `json:"pos"` }
func (*IsReceiveableFrom) GetType ¶
func (i *IsReceiveableFrom) GetType() Type
func (*IsReceiveableFrom) MarshalJSON ¶
func (o *IsReceiveableFrom) MarshalJSON() (b []byte, e error)
func (*IsReceiveableFrom) UnmarshalJSON ¶
func (o *IsReceiveableFrom) UnmarshalJSON(b []byte) error
type IsReferenceable ¶
func (*IsReferenceable) GetType ¶
func (i *IsReferenceable) GetType() Type
func (*IsReferenceable) MarshalJSON ¶
func (o *IsReferenceable) MarshalJSON() (b []byte, e error)
func (*IsReferenceable) UnmarshalJSON ¶
func (o *IsReferenceable) UnmarshalJSON(b []byte) error
type IsSendableTo ¶
type IsSendableTo struct { X typevars.Interface `json:"x"` Y typevars.Interface `json:"y"` Pos string `json:"pos"` }
func (*IsSendableTo) GetType ¶
func (i *IsSendableTo) GetType() Type
func (*IsSendableTo) MarshalJSON ¶
func (o *IsSendableTo) MarshalJSON() (b []byte, e error)
func (*IsSendableTo) UnmarshalJSON ¶
func (o *IsSendableTo) UnmarshalJSON(b []byte) error
type PropagatesTo ¶
type PropagatesTo struct { X typevars.Interface `json:"x"` Y typevars.Interface `json:"y"` ExpectedType gotypes.DataType `json:"expectedtype"` ToVariable bool `json:"tovariable"` Pos string `json:"pos"` }
func (*PropagatesTo) GetType ¶
func (p *PropagatesTo) GetType() Type
func (*PropagatesTo) MarshalJSON ¶
func (o *PropagatesTo) MarshalJSON() (b []byte, e error)
func (*PropagatesTo) UnmarshalJSON ¶
func (o *PropagatesTo) UnmarshalJSON(b []byte) error
type ReferenceOf ¶
type ReferenceOf struct { X typevars.Interface `json:"x"` Y typevars.Interface `json:"y"` Pos string `json:"pos"` }
func (*ReferenceOf) GetType ¶
func (i *ReferenceOf) GetType() Type
func (*ReferenceOf) MarshalJSON ¶
func (o *ReferenceOf) MarshalJSON() (b []byte, e error)
func (*ReferenceOf) UnmarshalJSON ¶
func (o *ReferenceOf) UnmarshalJSON(b []byte) error
type Type ¶
type Type string
var BinaryOpType Type = "binaryop"
var DereferenceOfType Type = "dereferenceOf"
var HasFieldType Type = "hasfield"
var IsCompatibleWithType Type = "iscompatiblewith"
var IsDereferenceableType Type = "Isdereferenceable"
var IsIncDecableType Type = "isincdecable"
var IsIndexableType Type = "isindexable"
var IsInvocableType Type = "isinvocable"
var IsRangeableType Type = "israngeable"
var IsReceiveableFromType Type = "isreceiveablefrom"
var IsReferenceableType Type = "isreferenceable"
var IsSendableToType Type = "issendableto"
var PropagatesToType Type = "propagatesto"
var ReferenceOfType Type = "referenceof"
var TypecastsToType Type = "typecaststo"
var UnaryOpType Type = "unaryop"
type TypecastsTo ¶
type TypecastsTo struct { X typevars.Interface `json:"x"` Type typevars.Interface `json:"castedtype"` Y typevars.Interface `json:"y"` ExpectedType gotypes.DataType `json:"expectedtype"` Pos string `json:"pos"` }
func (*TypecastsTo) GetType ¶
func (p *TypecastsTo) GetType() Type
func (*TypecastsTo) MarshalJSON ¶
func (o *TypecastsTo) MarshalJSON() (b []byte, e error)
func (*TypecastsTo) UnmarshalJSON ¶
func (o *TypecastsTo) UnmarshalJSON(b []byte) error
Click to show internal directories.
Click to hide internal directories.