[BUG] Reassigning a variable causes a null exception to be thrown
AkramIzz opened this issue · comments
Describe the bug
Reassigning a variable causes a null exception to be thrown.
Unhandled exception:
NoSuchMethodError: The getter 'type' was called on null.
Receiver: null
Tried calling: type
#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
#1 visitVarAssignment (package:Birb/utils/runtime.dart:504:17)
<asynchronous suspension>
#2 visit (package:Birb/utils/runtime.dart:219:20)
#3 visitCompound (package:Birb/utils/runtime.dart:869:25)
<asynchronous suspension>
#4 visit (package:Birb/utils/runtime.dart:245:20)
#5 main (package:Birb/birb.dart:43:15)
#6 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#7 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
To Reproduce
Steps to reproduce the behavior:
- Launch birb shell with the
birb
command - Type
var x = 1;
x = 2;
- Run program with
runBirb
command - See error
Expected behavior
Expected no error to be thrown