*** empty log message ***
diff --git a/compiler/org/eclipse/jdt/internal/compiler/ast/AssertStatement.java b/compiler/org/eclipse/jdt/internal/compiler/ast/AssertStatement.java
index 4bf3dc6..db2aed3 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/ast/AssertStatement.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/ast/AssertStatement.java
@@ -110,8 +110,11 @@
public void resolve(BlockScope scope) {
assertExpression.resolveTypeExpecting(scope, BooleanBinding);
if (exceptionArgument != null) {
- TypeBinding exceptionArgumentTB = exceptionArgument.resolveType(scope);
- exceptionArgument.implicitConversion = (exceptionArgumentTB.id << 4) + exceptionArgumentTB.id;
+ TypeBinding exceptionArgumentType = exceptionArgument.resolveType(scope);
+ if (exceptionArgumentType.id == T_void){
+ scope.problemReporter().illegalVoidExpression(exceptionArgument);
+ }
+ exceptionArgument.implicitConversion = (exceptionArgumentType.id << 4) + exceptionArgumentType.id;
}
}
diff --git a/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemIrritants.java b/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemIrritants.java
index 31c3e55..279b670 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemIrritants.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemIrritants.java
@@ -120,6 +120,8 @@
final int CannotReturnInInitializer = Internal + 162;
final int InitializerMustCompleteNormally = Internal + 163;
+ // assert
+ final int InvalidVoidExpression = Internal + 164;
// try
final int MaskedCatch = TypeRelated + 165;
final int DuplicateDefaultCase = 166;
diff --git a/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java b/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
index 2f36279..42396d9 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
@@ -976,6 +976,13 @@
type.sourceStart(),
type.sourceEnd());
}
+public void illegalVoidExpression(AstNode location) {
+ this.handle(
+ InvalidVoidExpression,
+ new String[] {},
+ location.sourceStart,
+ location.sourceEnd);
+}
public void importProblem(ImportReference importRef, Binding expectedImport) {
int problemId = expectedImport.problemId();
switch (problemId) {
diff --git a/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties b/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties
index fd48c51..a9f57eb 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties
+++ b/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties
@@ -89,7 +89,7 @@
161 = Unreachable code
162 = Cannot return from within an initializer
163 = Initializer does not complete normally
-
+164 = Expression must return a value
165 = Catch block is hidden by another one in the same try statement
166 = Duplicate default case
167 = Unreachable catch block