mirror of https://github.com/AMT-Cheif/drift.git
Avoid InconsistentAnalysisException in preprocess builder
This commit is contained in:
parent
43f90b6a43
commit
4575287ba4
|
@ -102,16 +102,13 @@ class PreprocessBuilder extends Builder {
|
|||
// we can now resolve the library we just wrote
|
||||
|
||||
final createdLibrary = await buildStep.resolver.libraryFor(tempDartAsset);
|
||||
final resolveResult = await createdLibrary.session
|
||||
.getResolvedLibraryByElement(createdLibrary);
|
||||
|
||||
final serializer = TypeSerializer(buildStep.resolver);
|
||||
final codeToType = <String, SerializedType>{};
|
||||
|
||||
for (var i = 0; i < dartLexemes.length; i++) {
|
||||
final member =
|
||||
_findVariableDefinition(_nameForDartExpr(i), createdLibrary);
|
||||
final node = resolveResult.getElementDeclaration(member).node
|
||||
final node = await buildStep.resolver.astNodeFor(member, resolve: true)
|
||||
as VariableDeclaration;
|
||||
|
||||
final type = node.initializer.staticType;
|
||||
|
|
Loading…
Reference in New Issue