Merge pull request #223 from leftylink/init_without_ctor

Change ANONYMOUS_INITIALIZER from _WITHOUT_CONSTRUCTOR to _IN_TRAIT
This commit is contained in:
Andrey Breslav
2013-03-11 03:19:28 -07:00
4 changed files with 5 additions and 5 deletions
@@ -524,7 +524,7 @@ public interface Errors {
DiagnosticFactory0<JetDeclarationWithBody>
NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY = DiagnosticFactory0.create(ERROR, DECLARATION_WITH_BODY);
DiagnosticFactory0<JetClassInitializer> ANONYMOUS_INITIALIZER_WITHOUT_CONSTRUCTOR = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0<JetClassInitializer> ANONYMOUS_INITIALIZER_IN_TRAIT = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0<JetThisExpression> NO_THIS = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0<JetRootNamespaceExpression> NAMESPACE_IS_NOT_AN_EXPRESSION = DiagnosticFactory0.create(ERROR);
@@ -305,7 +305,7 @@ public class DefaultErrorMessages {
MAP.put(NOT_A_LOOP_LABEL, "The label ''{0}'' does not denote a loop", TO_STRING);
MAP.put(NOT_A_RETURN_LABEL, "The label ''{0}'' does not reference to a context from which we can return", TO_STRING);
MAP.put(ANONYMOUS_INITIALIZER_WITHOUT_CONSTRUCTOR, "Anonymous initializers are only allowed in the presence of a primary constructor");
MAP.put(ANONYMOUS_INITIALIZER_IN_TRAIT, "Anonymous initializers are not allowed in traits");
MAP.put(NULLABLE_SUPERTYPE, "A supertype cannot be nullable");
MAP.put(REDUNDANT_NULLABLE, "Redundant '?'");
MAP.put(BASE_WITH_NULLABLE_UPPER_BOUND, "''{0}'' has a nullable upper bound. " +
@@ -346,7 +346,7 @@ public class BodyResolver {
}
else {
for (JetClassInitializer anonymousInitializer : anonymousInitializers) {
trace.report(ANONYMOUS_INITIALIZER_WITHOUT_CONSTRUCTOR.on(anonymousInitializer));
trace.report(ANONYMOUS_INITIALIZER_IN_TRAIT.on(anonymousInitializer));
}
}
}
@@ -1,11 +1,11 @@
trait NoC {
<!ANONYMOUS_INITIALIZER_WITHOUT_CONSTRUCTOR!>{
<!ANONYMOUS_INITIALIZER_IN_TRAIT!>{
}<!>
val a : Int get() = 1
<!ANONYMOUS_INITIALIZER_WITHOUT_CONSTRUCTOR!>{
<!ANONYMOUS_INITIALIZER_IN_TRAIT!>{
}<!>
}