Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit af2ee34

Browse files
author
John Messerly
committed
fix analyzer warnings and hints
found this with: $ dartanalyzer --fatal-warnings --package-warnings bin/devc.dart | (! grep $PWD) [email protected], [email protected] Review URL: https://chromereviews.googleplex.com/147897013
1 parent f2b5994 commit af2ee34

File tree

5 files changed

+3
-11
lines changed

5 files changed

+3
-11
lines changed

lib/src/checker/rules.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,15 +253,15 @@ class RestrictedRules extends TypeRules {
253253

254254
// "Traditional" name-based subtype check.
255255
if (t1 is InterfaceType && t2 is InterfaceType) {
256-
return _isInterfaceSubTypeOf(t1 as InterfaceType, t2 as InterfaceType);
256+
return _isInterfaceSubTypeOf(t1, t2);
257257
}
258258

259259
if (t1 is! FunctionType && t2 is! FunctionType) return false;
260260

261261
if (t1 is InterfaceType && t2 is FunctionType) {
262262
var callType = getCallMethodType(t1);
263263
if (callType == null) return false;
264-
return isFunctionSubTypeOf(callType, t2 as FunctionType);
264+
return isFunctionSubTypeOf(callType, t2);
265265
}
266266

267267
if (t1 is FunctionType && t2 is InterfaceType) {

lib/src/codegen/ast_builder.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ class AstBuilder {
117117
static FunctionExpression expressionFunction(
118118
List<FormalParameter> params, Expression body, [bool decl = false]) {
119119
FormalParameterList fl = formalParameterList(params);
120-
Token semi = (decl) ? new Token(TokenType.SEMICOLON, 0) : null;
121120
ExpressionFunctionBody b = RawAstBuilder.expressionFunctionBody(body, decl);
122121
return RawAstBuilder.functionExpression(fl, b);
123122
}

lib/src/codegen/code_generator.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import 'dart:async' show Future;
44
import 'dart:io';
55

66
import 'package:analyzer/src/generated/ast.dart' show CompilationUnit;
7-
import 'package:analyzer/src/generated/element.dart';
87
import 'package:path/path.dart' as path;
98

109
import 'package:ddc/src/info.dart';

lib/src/codegen/js_codegen.dart

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,6 @@ var $libName;
297297
void _initializeFields(List<FieldDeclaration> fields,
298298
[FormalParameterList parameters,
299299
NodeList<ConstructorInitializer> initializers]) {
300-
var initialized = new Set<String>();
301300

302301
// Run field initializers if they can have side-effects.
303302
var unsetFields = new Map<String, Expression>();
@@ -1104,8 +1103,3 @@ class JSGenerator extends CodeGenerator {
11041103
return new UnitGenerator(unit, libraryDir, info, rules).generate();
11051104
}
11061105
}
1107-
1108-
class _Property {
1109-
MethodDeclaration getter;
1110-
MethodDeclaration setter;
1111-
}

lib/src/codegen/reify_coercions.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ class TypeManager {
421421
var tpl = alias.typeParameters;
422422
if (tpl != null) {
423423
var ltp = tpl.typeParameters;
424-
var ts = ltp.map((t) => AstBuilder.typeName(t.name, null));
424+
ts = ltp.map((t) => AstBuilder.typeName(t.name, null));
425425
}
426426
var name = alias.name;
427427
return AstBuilder.typeName(name, ts);

0 commit comments

Comments
 (0)