| Index: compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
|
| diff --git a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
|
| index 50b57754640065acf336184be7f882206cb1b31e..1075cef3e5636afd8b2d7cf398c7612dddc6fb54 100644
|
| --- a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
|
| +++ b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
|
| @@ -758,14 +758,15 @@ public class TypeAnalyzer implements DartCompilationPhase {
|
| case FUNCTION:
|
| FunctionType ftype = (FunctionType) condition;
|
| Type returnType = ftype.getReturnType();
|
| - if (returnType.getKind().equals(TypeKind.VOID)) {
|
| - typeError(conditionNode, TypeErrorCode.VOID);
|
| + if (!types.isAssignable(boolType, returnType) || !ftype.getParameterTypes().isEmpty()) {
|
| + typeError(node, TypeErrorCode.ASSERT_BOOL);
|
| }
|
| - checkAssignable(conditionNode, boolType, returnType);
|
| break;
|
|
|
| default:
|
| - checkAssignable(conditionNode, boolType, condition);
|
| + if (!types.isAssignable(boolType, condition)) {
|
| + typeError(node, TypeErrorCode.ASSERT_BOOL);
|
| + }
|
| break;
|
| }
|
| return voidType;
|
|
|