Skip to content

Commit

Permalink
Fix a bug where the wrong module was used for identity comparisons (#949
Browse files Browse the repository at this point in the history
)
  • Loading branch information
nex3 authored Feb 8, 2020
1 parent 67c4e1b commit 718cfdd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions lib/src/async_environment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,10 @@ class AsyncEnvironment {
var view = ForwardedModuleView(module, rule);
for (var other in _forwardedModules) {
_assertNoConflicts(
view.variables, other.variables, module, other, "variable", rule);
view.variables, other.variables, view, other, "variable", rule);
_assertNoConflicts(
view.functions, other.functions, module, other, "function", rule);
_assertNoConflicts(
view.mixins, other.mixins, module, other, "mixin", rule);
view.functions, other.functions, view, other, "function", rule);
_assertNoConflicts(view.mixins, other.mixins, view, other, "mixin", rule);
}

// Add the original module to [_allModules] (rather than the
Expand Down Expand Up @@ -315,8 +314,9 @@ class AsyncEnvironment {

for (var name in smaller.keys) {
if (!larger.containsKey(name)) continue;
if (newModule.variableIdentity(name) ==
oldModule.variableIdentity(name)) {
if (type == "variable" &&
newModule.variableIdentity(name) ==
oldModule.variableIdentity(name)) {
continue;
}

Expand Down
14 changes: 7 additions & 7 deletions lib/src/environment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// DO NOT EDIT. This file was generated from async_environment.dart.
// See tool/grind/synchronize.dart for details.
//
// Checksum: 6666522945667f7f041530ee545444b7b40cfc80
// Checksum: 90df4751419f38332128857f9e02d481cbd7e5a7
//
// ignore_for_file: unused_import

Expand Down Expand Up @@ -283,11 +283,10 @@ class Environment {
var view = ForwardedModuleView(module, rule);
for (var other in _forwardedModules) {
_assertNoConflicts(
view.variables, other.variables, module, other, "variable", rule);
view.variables, other.variables, view, other, "variable", rule);
_assertNoConflicts(
view.functions, other.functions, module, other, "function", rule);
_assertNoConflicts(
view.mixins, other.mixins, module, other, "mixin", rule);
view.functions, other.functions, view, other, "function", rule);
_assertNoConflicts(view.mixins, other.mixins, view, other, "mixin", rule);
}

// Add the original module to [_allModules] (rather than the
Expand Down Expand Up @@ -322,8 +321,9 @@ class Environment {

for (var name in smaller.keys) {
if (!larger.containsKey(name)) continue;
if (newModule.variableIdentity(name) ==
oldModule.variableIdentity(name)) {
if (type == "variable" &&
newModule.variableIdentity(name) ==
oldModule.variableIdentity(name)) {
continue;
}

Expand Down

0 comments on commit 718cfdd

Please sign in to comment.