Skip to content

Commit b61aabf

Browse files
committed
Test fix for bad typing
1 parent 51c6aa4 commit b61aabf

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: source_gen
2-
version: 0.5.0+1
2+
version: 0.5.1-dev
33
author: Dart Team <[email protected]>
44
description: Automatic sourcecode generation for Dart
55
homepage: https://github.com/dart-lang/source_gen

test/json_serializable_test.dart

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,17 +115,12 @@ void main() {
115115
const _generator = const JsonSerializableGenerator();
116116

117117
Future<Element> _getClassForCodeString(String name) async {
118-
var elements = await _getElementsForCodeString();
119-
120-
return elements.singleWhere((e) => e.name == name);
121-
}
122-
123-
Future<List<Element>> _getElementsForCodeString() async {
124118
if (_compUnit == null) {
125119
_compUnit = await _getCompilationUnitForString(getPackagePath());
126120
}
127121

128-
return getElementsFromLibraryElement(_compUnit.element.library);
122+
return getElementsFromLibraryElement(_compUnit.element.library)
123+
.singleWhere((e) => e.name == name);
129124
}
130125

131126
Future<CompilationUnit> _getCompilationUnitForString(String projectPath) async {

0 commit comments

Comments
 (0)