org.eclipse.xtext.xbase.typesystem.computation
Interface ITypeExpectation

All Known Implementing Classes:
AbstractReturnAwareTypeExpectation, AbstractRootTypeExpectation, AbstractTypeExpectation, NoExpectation, ObservableTypeExpectation, RootNoExpectation, RootTypeExpectation, TypeExpectation

public interface ITypeExpectation

Author:
Sebastian Zarnekow - Initial contribution and API
This interface is not intended to be implemented by clients.
This interface is not intended to be implemented by clients. TODO JavaDoc, toString

Method Summary
 void acceptActualType(JvmTypeReference type, ConformanceHint hint)
           
 JvmTypeReference getExpectedType()
          Returns the expected type.
 boolean isNoTypeExpectation()
          Returns true if anything is allowed and no constraints are expected.
 boolean isVoidTypeAllowed()
          Returns true if Void.TYPE is a valid type.
 

Method Detail

acceptActualType

void acceptActualType(JvmTypeReference type,
                      ConformanceHint hint)

getExpectedType

JvmTypeReference getExpectedType()
Returns the expected type. The expected type may be not too concrete thus getExpectedType() may return null or some sort of unresolved, specialized reference. If null is returned, clients may want to check isNoTypeExpectation() or isVoidTypeAllowed().

Returns:
the expected type. This may be null.

isNoTypeExpectation

boolean isNoTypeExpectation()
Returns true if anything is allowed and no constraints are expected.

Returns:
true if anything is allowed and no constraints are expected.

isVoidTypeAllowed

boolean isVoidTypeAllowed()
Returns true if Void.TYPE is a valid type. It may be the only valid type or there may exist others.

Returns:
true if primitive void is allowed.