Page 1 of 1

Error 2 Internal error!

PostPosted: February 7th, 2013, 5:38 am
by tgo57
I just downloaded and installed the latest version of Phalanger on Visual Studio 2010, I created a new WinForm project in PHP and got this error on the following code:

Error 2 Internal error!
Please, report this bug via http://www.codeplex.com/WorkItem/List.a ... =Phalanger.
Additional information:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: startIndex
at System.String.CtorCharArrayStartLength(Char[] value, Int32 startIndex, Int32 length)
at PHP.Core.Parsers.Lexer.GetTokenString(Position position)
at PHP.Core.Parsers.Parser.CSharpNameToken(Position position)
at PHP.Core.Parsers.Parser.DoAction(Int32 action)
at PHP.Core.Parsers.GPPG.ShiftReduceParser`2.Reduce(Int32 rule_nr)
at PHP.Core.Parsers.GPPG.ShiftReduceParser`2.Parse()
at PHP.Core.Parsers.Parser.Parse(SourceUnit sourceUnit, TextReader reader, ErrorSink errors, IReductionsSink reductionsSink, Position initialPosition, LexicalStates initialLexicalState, LanguageFeatures features)
at PHP.Core.Reflection.SourceFileUnit.Parse(ErrorSink errors, IReductionsSink reductionsSink, Position initialPosition, LanguageFeatures features)
at PHP.Core.Reflection.PureCompilationUnit.ParseSourceFiles[S](IEnumerable`1 sourceUnits, ErrorSink errors, LanguageFeatures languageFeatures)
at PHP.Core.Reflection.PureCompilationUnit.Compile(IEnumerable`1 sourceFiles, PureAssemblyBuilder assemblyBuilder, CompilationContext context, Encoding encoding)
at PHP.Core.Emit.PureAssemblyBuilder.Build(IEnumerable`1 sourceFiles, CompilationContext context)
at PHP.Core.ApplicationCompiler.Compile(ApplicationContext applicationContext, CompilerConfiguration config, ErrorSink errorSink, CompilationParameters ps)
-1 1 WindowsApplication1




<?
namespace WindowsApplication1 {

[\Export]
partial class Form1 extends \System\Windows\Forms\Form {

private $components = NULL;

public function __construct()
: parent() {
$this->InitializeComponent();
}

public function InitializeComponent() {
$this->SuspendLayout();
//
// Form1
//
$this->AutoScaleDimensions = new \System\Drawing\SizeF(6, 13);
$this->AutoScaleMode = \System\Windows\Forms\AutoScaleMode::Font;
$this->ClientSize = new \System\Drawing\Size(595, 266);
$this->Name = "Form1";
$this->Text = "Form1";
$this->Load->Add(new \System\EventHandler(array($this, "Form1_Load")));
$this->ResumeLayout(false);
}

private function Form1_Load(\System\Object $sender, \System\EventArgs $e) {

echo "Hello World";
}
}
}
?>

Re: Error 2 Internal error!

PostPosted: February 7th, 2013, 9:57 am
by Jakub Misek
Thank You! I can replicate the issue, so we can fix this in a future update.
Thanks!

Re: Error 2 Internal error!

PostPosted: February 12th, 2013, 11:12 am
by Jakub Misek
This issues has been fixed. If you compile Phalanger from sources (https://github.com/DEVSENSE/Phalanger), you should not be experiencing this again.

Thanks!