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

Commit 21aeeec

Browse files
author
John Messerly
committed
fix analysis messages
seen on the latest dev channel editor w/ analysis server [email protected] Review URL: https://codereview.chromium.org/962213003
1 parent d6195e0 commit 21aeeec

File tree

8 files changed

+10
-25
lines changed

8 files changed

+10
-25
lines changed

lib/runtime/dart_runtime.dart

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -128,21 +128,7 @@ Arity getArity(Function f) {
128128
return new Arity._internal(normal, optionalPositional);
129129
}
130130

131-
bool _isFunctionSubType(TypeMirror t1, TypeMirror t2) {
132-
// Function types follow the standard non-Dart rule:
133-
// - contravariant on param types
134-
// - covariant on return type
135-
final f1 = t1 as FunctionTypeMirror;
136-
final f2 = t2 as FunctionTypeMirror;
137-
138-
final params1 = f1.parameters;
139-
final params2 = f2.parameters;
140-
final ret1 = f1.returnType;
141-
final ret2 = f2.returnType;
142-
return _isFunctionSubTypeHelper(ret1, params1, ret2, params2);
143-
}
144-
145-
bool _isFunctionSubTypeHelper(TypeMirror ret1, List<ParameterMirror> params1,
131+
bool _isFunctionSubType(TypeMirror ret1, List<ParameterMirror> params1,
146132
TypeMirror ret2, List<ParameterMirror> params2) {
147133
if (!_isSubType(ret1, ret2)) {
148134
// Covariant return types
@@ -334,5 +320,5 @@ bool _isSubType(TypeMirror t1, TypeMirror t2) {
334320
if (_reflects(c2, Function)) return true;
335321

336322
// Check structural function subtyping
337-
return _isFunctionSubTypeHelper(ret1, params1, c2.returnType, c2.parameters);
323+
return _isFunctionSubType(ret1, params1, c2.returnType, c2.parameters);
338324
}

lib/src/testing.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,8 @@ class _TestSource implements Source {
287287

288288
bool exists() => true;
289289

290+
Source get source => this;
291+
290292
String _encoding;
291293
String get encoding => _encoding != null ? _encoding : (_encoding = '$uri');
292294

test/checker/inferred_type_test.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,6 @@ main() {
379379
final e2 = 1;
380380
}
381381
''',
382-
'/e2.dart': '',
383382
'/f.dart': '''
384383
part "f2.dart";
385384
''',

test/codegen/dir/html_input_c.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5+
library html_input_c;
6+
57
import 'html_input_e.dart';
68

79
int y = 3 + w;

test/codegen/dom.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,8 @@ class Overload {
2020
}
2121
const overload = const Overload();
2222

23-
// TODO(jmesserly): uncomment once fix lands for:
24-
// https://github.com/dart-lang/dart_style/issues/85
25-
// @JsGlobal()
26-
final Document document;
23+
@JsGlobal()
24+
final Document document = null;
2725

2826
@JsType(name: 'Document')
2927
abstract class Document {

test/codegen/fieldtest.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ int y = compute() + 444;
3131

3232
String get q => 'life, ' + 'the universe ' + 'and everything';
3333
int get z => 42;
34-
int set z(value) {
34+
void set z(value) {
3535
y = value;
3636
}
3737

test/codegen_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ main(arguments) {
124124
? path.join(testDir, '..', 'tool', 'input_sdk_src')
125125
: path.join(testDir, 'generated_sdk');
126126
var testSdk = new TypeResolver.fromDir(sdkPath, options);
127-
var result = compile('dart:core', testSdk, options);
127+
compile('dart:core', testSdk, options);
128128
var outputDir = new Directory(path.join(actualDir, 'core'));
129129
expect(outputDir.existsSync(), true,
130130
reason: '${outputDir.path} was created for dart:core');

tool/patch_sdk.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ List<String> _patchLibrary(List<String> partsContents, String patchContents) {
108108
var patchFinder = new PatchFinder.parseAndVisit(patchContents);
109109

110110
// Merge `external` declarations with the corresponding `@patch` code.
111-
bool first = true;
112111
for (var partContent in partsContents) {
113112
var partEdits = new StringEditBuffer(partContent);
114113
var partUnit = parseCompilationUnit(partContent);
@@ -138,7 +137,6 @@ class PatchApplier extends GeneralizingAstVisitor {
138137
// TODO(jmesserly): remove duplicate imports
139138
var directivePos = unit.directives.last.end;
140139
for (var directive in patch.unit.directives) {
141-
var uri = directive.uri.stringValue;
142140
var code = patch.contents.substring(directive.offset, directive.end);
143141
edits.insert(directivePos, '\n' + code);
144142
}

0 commit comments

Comments
 (0)