Calamity210 / BirbLang

Minimal Bird programming language curated to help new contributers delve into OSS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[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:

  1. Launch birb shell with the birb command
  2. Type
var x = 1;
x = 2;
  1. Run program with runBirb command
  2. See error

Expected behavior
Expected no error to be thrown

commented

Corrected in 4abdc29