additionType

open fun additionType(other: ShakeType, scope: ShakeScope): ShakeType?(source)

Returns the type of the expression this + other If the add operator is not overloaded, this method should look for a default add operator and resolve the type itself. This isi the default implementation of additionType, we don't know anything about the type here and so we just try to search for an overloaded operator.

In implementation of additionType should look something like this:

override fun additionType(other: ShakeType, scope: ShakeScope): ShakeType? {
return super.additionType(other, scope) ?: ... // default operator stuff
}

Return

The return type of the add expression

Since

0.1.0

Parameters

other

The type to add

scope

The scope in which the add is done