Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(809)

Side by Side Diff: sdk/lib/_internal/compiler/implementation/warnings.dart

Issue 17447003: Correctly type check type variable expressions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart2js; 5 part of dart2js;
6 6
7 class MessageKind { 7 class MessageKind {
8 final String template; 8 final String template;
9 const MessageKind(this.template); 9 const MessageKind(this.template);
10 10
11 static const GENERIC = const MessageKind('#{text}'); 11 static const GENERIC = const MessageKind('#{text}');
12 12
13 static const NOT_ASSIGNABLE = const MessageKind( 13 static const NOT_ASSIGNABLE = const MessageKind(
14 '#{fromType} is not assignable to #{toType}'); 14 '#{fromType} is not assignable to #{toType}');
15 static const VOID_EXPRESSION = const MessageKind( 15 static const VOID_EXPRESSION = const MessageKind(
16 'expression does not yield a value'); 16 'expression does not yield a value');
17 static const VOID_VARIABLE = const MessageKind( 17 static const VOID_VARIABLE = const MessageKind(
18 'variable cannot be of type void'); 18 'variable cannot be of type void');
19 static const RETURN_VALUE_IN_VOID = const MessageKind( 19 static const RETURN_VALUE_IN_VOID = const MessageKind(
20 'cannot return value from void function'); 20 'cannot return value from void function');
21 static const RETURN_NOTHING = const MessageKind( 21 static const RETURN_NOTHING = const MessageKind(
22 'value of type #{returnType} expected'); 22 'value of type #{returnType} expected');
23 static const MISSING_ARGUMENT = const MessageKind( 23 static const MISSING_ARGUMENT = const MessageKind(
24 'missing argument of type #{argumentType}'); 24 'missing argument of type #{argumentType}');
25 static const ADDITIONAL_ARGUMENT = const MessageKind( 25 static const ADDITIONAL_ARGUMENT = const MessageKind(
26 'additional argument'); 26 'additional argument');
27 static const NAMED_ARGUMENT_NOT_FOUND = const MessageKind( 27 static const NAMED_ARGUMENT_NOT_FOUND = const MessageKind(
28 "no named argument '#{argumentName}' found on method"); 28 "no named argument '#{argumentName}' found on method");
29 static const MEMBER_NOT_FOUND = const MessageKind(
30 'no member named #{memberName} in class #{className}');
29 static const METHOD_NOT_FOUND = const MessageKind( 31 static const METHOD_NOT_FOUND = const MessageKind(
30 'no method named #{memberName} in class #{className}'); 32 'no method named #{memberName} in class #{className}');
31 static const OPERATOR_NOT_FOUND = const MessageKind( 33 static const OPERATOR_NOT_FOUND = const MessageKind(
32 'no operator #{memberName} in class #{className}'); 34 'no operator #{memberName} in class #{className}');
33 static const PROPERTY_NOT_FOUND = const MessageKind( 35 static const PROPERTY_NOT_FOUND = const MessageKind(
34 'no property named #{memberName} in class #{className}'); 36 'no property named #{memberName} in class #{className}');
35 static const NOT_CALLABLE = const MessageKind( 37 static const NOT_CALLABLE = const MessageKind(
36 "'#{elementName}' is not callable"); 38 "'#{elementName}' is not callable");
37 static const MEMBER_NOT_STATIC = const MessageKind( 39 static const MEMBER_NOT_STATIC = const MessageKind(
38 '#{className}.#{memberName} is not static'); 40 '#{className}.#{memberName} is not static');
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 627
626 class CompileTimeConstantError extends Diagnostic { 628 class CompileTimeConstantError extends Diagnostic {
627 CompileTimeConstantError(MessageKind kind, [Map arguments = const {}]) 629 CompileTimeConstantError(MessageKind kind, [Map arguments = const {}])
628 : super(kind, arguments); 630 : super(kind, arguments);
629 } 631 }
630 632
631 class CompilationError extends Diagnostic { 633 class CompilationError extends Diagnostic {
632 CompilationError(MessageKind kind, [Map arguments = const {}]) 634 CompilationError(MessageKind kind, [Map arguments = const {}])
633 : super(kind, arguments); 635 : super(kind, arguments);
634 } 636 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/typechecker.dart ('k') | tests/compiler/dart2js/type_checker_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698