question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

better way to determine which file caused the error

See original GitHub issue

Tried with Unity Editor Tool. Current latest (UnityScript2CSharp_Conversion_1.0.6998.28881.unitypackage)

i had 302 script files in the project and i have no clue which file caused it.

in the output the only thing i see

`Defined Symbols: Internal compiler error: Object reference not set to an instance of an object…

at Boo.Lang.Compiler.Ast.DepthFirstVisitor.OnError(Node node, Exception error) in m:\Work\Repo\boo\src\Boo.Lang.Compiler\Ast\DepthFirstVisitor.cs:line 83 at Boo.Lang.Compiler.Ast.DepthFirstVisitor.Visit(Node node) in m:\Work\Repo\boo\src\Boo.Lang.Compiler\Ast\DepthFirstVisitor.cs:line 55 at Boo.Lang.Compiler.Ast.DepthFirstVisitor.Visit(Node[] array) in m:\Work\Repo\boo\src\Boo.Lang.Compiler\Ast\DepthFirstVisitor.cs:line 112 at Boo.Lang.Compiler.Ast.DepthFirstVisitor.Visit[T](NodeCollection1 collection) in m:\Work\Repo\boo\src\Boo.Lang.Compiler\Ast\DepthFirstVisitor.cs:line 119 at Boo.Lang.Compiler.Ast.DepthFirstVisitor.OnBlock(Block node) in m:\Work\Repo\boo\src\Boo.Lang.Compiler\Ast\Impl\DepthFirstVisitor.cs:line 722 at UnityScript2CSharp.UnityScript2CSharpConverterVisitor.OnBlock(Block node) in G:\Work\repo\unityscript2csharp\UnityScript2CSharp\UnityScript2CSharpConverterVisitor.cs:line 496 at Boo.Lang.Compiler.Ast.Block.Accept(IAstVisitor visitor) in m:\Work\Repo\boo\src\Boo.Lang.Compiler\Ast\Impl\BlockImpl.cs:line 69 at UnityScript2CSharp.UnityScript2CSharpConverterVisitor.OnMethod(Method node) in G:\Work\repo\unityscript2csharp\UnityScript2CSharp\UnityScript2CSharpConverterVisitor.cs:line 319 at Boo.Lang.Compiler.Ast.Method.Accept(IAstVisitor visitor) in m:\Work\Repo\boo\src\Boo.Lang.Compiler\Ast\Impl\MethodImpl.cs:line 75 at UnityScript2CSharp.UnityScript2CSharpConverterVisitor.WriteMembersOf(TypeDefinition node) in G:\Work\repo\unityscript2csharp\UnityScript2CSharp\UnityScript2CSharpConverterVisitor.cs:line 1553 at UnityScript2CSharp.UnityScript2CSharpConverterVisitor.OnClassDefinition(ClassDefinition node) in G:\Work\repo\unityscript2csharp\UnityScript2CSharp\UnityScript2CSharpConverterVisitor.cs:line 174 at Boo.Lang.Compiler.Ast.ClassDefinition.Accept(IAstVisitor visitor) in m:\Work\Repo\boo\src\Boo.Lang.Compiler\Ast\Impl\ClassDefinitionImpl.cs:line 67 at Boo.Lang.Compiler.Ast.DepthFirstVisitor.Visit(Node node) in m:\Work\Repo\boo\src\Boo.Lang.Compiler\Ast\DepthFirstVisitor.cs:line 51 at Boo.Lang.Compiler.Ast.DepthFirstVisitor.Visit(Node[] array) in m:\Work\Repo\boo\src\Boo.Lang.Compiler\Ast\DepthFirstVisitor.cs:line 112 at Boo.Lang.Compiler.Ast.DepthFirstVisitor.Visit[T](NodeCollection1 collection) in m:\Work\Repo\boo\src\Boo.Lang.Compiler\Ast\DepthFirstVisitor.cs:line 119 at Boo.Lang.Compiler.Ast.DepthFirstVisitor.OnModule(Module node) in m:\Work\Repo\boo\src\Boo.Lang.Compiler\Ast\Impl\DepthFirstVisitor.cs:line 240 at UnityScript2CSharp.UnityScript2CSharpConverterVisitor.OnModule(Module node) in G:\Work\repo\unityscript2csharp\UnityScript2CSharp\UnityScript2CSharpConverterVisitor.cs:line 146 at Boo.Lang.Compiler.Ast.Module.Accept(IAstVisitor visitor) in m:\Work\Repo\boo\src\Boo.Lang.Compiler\Ast\Impl\ModuleImpl.cs:line 75 at Boo.Lang.Compiler.Ast.DepthFirstVisitor.Visit(Node node) in m:\Work\Repo\boo\src\Boo.Lang.Compiler\Ast\DepthFirstVisitor.cs:line 51 at Boo.Lang.Compiler.Ast.DepthFirstVisitor.Visit(Node[] array) in m:\Work\Repo\boo\src\Boo.Lang.Compiler\Ast\DepthFirstVisitor.cs:line 112 at Boo.Lang.Compiler.Ast.DepthFirstVisitor.Visit[T](NodeCollection1 collection) in m:\Work\Repo\boo\src\Boo.Lang.Compiler\Ast\DepthFirstVisitor.cs:line 119 at Boo.Lang.Compiler.Ast.DepthFirstVisitor.OnCompileUnit(CompileUnit node) in m:\Work\Repo\boo\src\Boo.Lang.Compiler\Ast\Impl\DepthFirstVisitor.cs:line 47 at Boo.Lang.Compiler.Ast.CompileUnit.Accept(IAstVisitor visitor) in m:\Work\Repo\boo\src\Boo.Lang.Compiler\Ast\Impl\CompileUnitImpl.cs:line 69 at UnityScript2CSharp.UnityScript2CSharpConverter.Convert(IEnumerable1 inputs, IEnumerable1 definedSymbols, IEnumerable1 referencedAssemblies, Action3 onScriptConverted) in G:\Work\repo\unityscript2csharp\UnityScript2CSharp\UnityScript2CSharpConverter.cs:line 43 at UnityScript2CSharp.Program.ConvertScripts(AssemblyType assemblyType, IList1 scripts, UnityScript2CSharpConverter converter, CommandLineArguments args, List1 referencedSymbols, HashSet1 compilerErrors) in G:\Work\repo\unityscript2csharp\UnityScript2CSharp\Program.cs:line 344 at UnityScript2CSharp.Program.Main(String[] args) in G:\Work\repo\unityscript2csharp\UnityScript2CSharp\Program.cs:line 76`

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Xian55commented, Mar 5, 2019

with the new unitypackage, i found the file which caused the error and also found the line. It’s interestring because the line is very simple.

In the MonoBehaviour Update() loop there is a line which will get a boolean variable var setActive : boolean = (player && player.enabled && IsIntInArray(player.animationIndex, animationIndexes));

There is only one MonoBehaviour object, the “player” the others are local variables primitives and functions.

If i comment this line out var setActive : boolean = (player && player.enabled && IsIntInArray(player.animationIndex, animationIndexes)); and replace with like var setActive : boolean = true //or false the converter dont produce the stack i provided at the first place.

function Update(){
		super.Update();
		var i : int;
		var setActive : boolean = (player && player.enabled && IsIntInArray(player.animationIndex, animationIndexes));
		if(isActive != setActive){
			for(i = 0; i < linkedEventTimings.Length; i++){
				linkedEventTimings[i].startedAlready = false;
			}
			if(setActive){
				RegisterEventStart();
			}
		}
		isActive = setActive;
		if(isActive){
			var animLength : float = player.GetLength();
			var animTime : float = player.GetTime();
			progress = animTime / animLength;
		}
	}
function IsIntInArray(_int : int, _array : Array) : boolean {
		var r : boolean = false;
		for (var i = 0; i < _array.length; i++) {
			if (_array[i] == _int) {
				r = true;
				break;
			}
		}
		return r;
	} 

I hope this information helps to improve the converter tool.

1reaction
adrianoccommented, Mar 5, 2019

Hi. Can you try with this version in verbose mode (button Convert (verbose)) ?

The last logged filename should be the one that caused the error.

UnityScript2CSharp_Conversion_1.0.7002.42237.unitypackage.zip

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to find out which file caused the exception?
I am using FileReader wrapped in BufferedReader to read from 2 files, in case of an exception being thrown I want to know...
Read more >
FIO02-J. Detect and handle file-related errors
Detect and handle file-related errors ... Java's file-manipulation methods often indicate failure with a return value instead of throwing an exception.
Read more >
Improper Error Handling
More thorough testing is usually required to cause internal errors to occur and see how the site behaves. Another valuable approach is to...
Read more >
Fix program errors and improve code - Visual Studio ...
This article describes some basic ways Visual Studio can help you find and fix problems in your code, including build errors, code analysis, ......
Read more >
A Definitive Guide to Handling Errors in JavaScript
The most appropriate approach to solve this error is to identify the cause via the error message and restructure your app logic, if...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found