-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UIP-1637 First pass at strong mode compliance #15
Changes from 3 commits
27c1a59
f2a5cc6
f1c6657
17f16fa
2804edf
d9071f8
af8d5f9
2914187
3b51626
0e7c44a
c2299be
fc1b96e
b76c072
fe69d03
46639f2
047a8a9
9d6a136
0fe7556
2507729
1b4a80a
d205ea9
5547f8d
c4dd932
f211b71
ba742e8
dd869c5
c8b41b7
98917e9
9a91b1d
1dbb92f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
analyzer: | ||
strong-mode: true | ||
exclude: | ||
- integrate/** | ||
linter: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -294,7 +294,7 @@ main() { | |
|
||
group('modifyProps()', () { | ||
test('passes the provided modifier itself', () { | ||
modifier(UiProps props) { | ||
modifier(Map<dynamic, dynamic> props) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. #nit Unnecessary parameters |
||
props['className'] = 'modified-class-name'; | ||
} | ||
|
||
|
@@ -702,7 +702,7 @@ class TestComponentComponent extends UiComponent<TestComponentProps> { | |
@override | ||
final List<ConsumedProps> consumedProps; | ||
|
||
TestComponentComponent({testConsumedProps}) : consumedProps = testConsumedProps; | ||
TestComponentComponent({List<ConsumedProps> testConsumedProps}) : consumedProps = testConsumedProps; | ||
|
||
@override | ||
render() => false; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,8 @@ main() { | |
} | ||
|
||
List<TestGenericType> generateBadTypeArgs() { | ||
return new List.generate(arity, (_) => new Object()); | ||
// ignore: Type check failed | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, I think this should just be |
||
return new List.generate(arity, (_) => new Object() as TestGenericType); | ||
} | ||
|
||
group('chain()', () { | ||
|
@@ -158,7 +159,7 @@ main() { | |
test('calls all functions in order', () { | ||
var calls = []; | ||
|
||
var functions = new List.generate(5, (index) { | ||
List<Function> functions = new List.generate(5, (index) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. #supernit for something like this, I think it might be preferred to do var functions = new List<Function>.generate(5, (index) { There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @greglittlefield-wf @evanweible-wf when I do that, I get the following test failures:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, sorry, should it be this, then? var functions = new List<Callback0Arg>.generate(5, (index) { I'm fine leaving it as-is if it works, though |
||
return createTestChainFunction(onCall: (args) { | ||
calls.add(['function_$index', args]); | ||
}); | ||
|
@@ -180,7 +181,7 @@ main() { | |
}); | ||
|
||
test('returns false when any function returns false', () { | ||
var functions = new List.generate(5, (_) => createTestChainFunction()); | ||
List<Function> functions = new List.generate(5, (_) => createTestChainFunction()); | ||
functions.insert(2, createTestChainFunction(returnValue: false)); | ||
|
||
var chained = callbackUtil.chainFromList(functions); | ||
|
@@ -189,7 +190,7 @@ main() { | |
}); | ||
|
||
test('returns null when no function returns false', () { | ||
var functions = new List.generate(5, (_) => createTestChainFunction()); | ||
List<Function> functions = new List.generate(5, (_) => createTestChainFunction()); | ||
|
||
var chained = callbackUtil.chainFromList(functions); | ||
|
||
|
@@ -201,7 +202,7 @@ main() { | |
test('null functions', () { | ||
var calls = []; | ||
|
||
var functions = new List.generate(5, (index) { | ||
List<Function> functions = new List.generate(5, (index) { | ||
return createTestChainFunction(onCall: (args) { | ||
calls.add(['function_$index', args]); | ||
}); | ||
|
@@ -236,7 +237,7 @@ main() { | |
|
||
if (arity != 0) { | ||
test('has arguments typed to the specified generic parameters', () { | ||
var functions = new List.generate(5, (_) => createTestChainFunction()); | ||
List<Function> functions = new List.generate(5, (_) => createTestChainFunction()); | ||
|
||
functions.forEach((function) { | ||
expect(() => Function.apply(function, generateArgs()), returnsNormally, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#nit Just so there is not a bunch of changes could the param be prefixed with an underscore and the new var not?