Page 1 of 1

Unexpected parent construct

PostPosted: October 16th, 2014, 6:38 pm
by davidbcn
I just download lasta phalanger update and nothing is compiling anymore!

I am getting hunders of these:

Error 2756 Unexpected parent constructor call (such call is allowed only in the constructor of the class extending a CLR type ....\AbstractCachedClassLoader.php 49 13 WebApplication1

It showing 3,000 of these errores in the project, I guess it is throwing this error for every single function inside a class...

Re: Unexpected parent construct

PostPosted: October 16th, 2014, 6:42 pm
by Jakub Misek
There was a change in determining constructor method; Can you send me a sample throwing this error please? We'll fix this asap.

Re: Unexpected parent construct

PostPosted: October 16th, 2014, 8:04 pm
by davidbcn
Create a new project (VS2013) of type Phalanger - Web.

Copy this in index.php:

<?php
class DatabaseConnection_sqlsrv extends DatabaseConnection {
public function driver() {
return 'sqlsrv';
}
}
?>

Try to compile...

Re: Unexpected parent construct

PostPosted: October 16th, 2014, 9:02 pm
by Jakub Misek
Thanks, I'll keep you informed in this thread.

Re: Unexpected parent construct

PostPosted: October 16th, 2014, 9:20 pm
by Jakub Misek
This fixes compilation of class methods.

http://www.devsense.com/products/phalan ... ad/preview

Thanks,

Re: Unexpected parent construct

PostPosted: October 16th, 2014, 11:07 pm
by davidbcn
That was blazing fast! Thank you!

After updating:

Error 219 Internal error!
Please, report this bug via http://phalanger.codeplex.com/workitem/list/basic.
Additional information:
Value cannot be null.
Parameter name: meth
at System.Reflection.Emit.ILGenerator.Emit(OpCode opcode, MethodInfo meth)
at PHP.Core.Emit.ILEmitter.Emit(OpCode opcode, MethodInfo meth)
at PHP.Core.CodeGenerator.EmitDeclareLamdaFunction(MethodInfo info)
at PHP.Core.Compiler.AST.NodeCompilers.DirectFcnCallCompiler.EmitInlinedFunctionCall(CodeGenerator codeGenerator)
at PHP.Core.Compiler.AST.NodeCompilers.DirectFcnCallCompiler.Emit(DirectFcnCall node, CodeGenerator codeGenerator)
at PHP.Core.Compiler.AST.NodeCompilers.ExpressionCompiler`1.PHP.Core.Compiler.AST.IExpressionCompiler.Emit(Expression node, CodeGenerator codeGenerator)
at PHP.Core.Compiler.AST.NodeCompilers.ActualParamCompiler.Emit(ActualParam node, CodeGenerator codeGenerator, Boolean ensureChainWritable)
at PHP.Core.Compiler.AST.NodeCompilers.CallSignatureCompiler.EmitLibraryLoadArgument(CallSignature node, ILEmitter il, Int32 index, Object codeGenerator, ParameterInfo param)
at PHP.Core.Compiler.AST.CallSignatureHelpers.EmitLibraryLoadArgument(CallSignature node, ILEmitter il, Int32 index, Object codeGenerator, ParameterInfo param)
at PHP.Core.Emit.OverloadsBuilder.EmitMandatoryArgumentLoad(Int32 index, ParameterInfo param)
at PHP.Core.Emit.OverloadsBuilder.EmitOverloadCall(MethodInfo method, ParameterInfo[] ps, Int32 phpParamCount, IPlace scriptContext, IPlace rtVariables, IPlace namingContext, IPlace classContext, IPlace optArgs, IPlace selfRef, Boolean ignoringReturnValue)
at PHP.Core.Reflection.PhpLibraryFunction.EmitCall(CodeGenerator codeGenerator, String fallbackQualifiedName, CallSignature callSignature, IPlace instance, Boolean runtimeVisibilityCheck, Int32 overloadIndex, DType type, Span position, AccessType access, Boolean callVirt)
at PHP.Core.Compiler.AST.NodeCompilers.DirectFcnCallCompiler.Emit(DirectFcnCall node, CodeGenerator codeGenerator)
at PHP.Core.Compiler.AST.NodeCompilers.ExpressionCompiler`1.PHP.Core.Compiler.AST.IExpressionCompiler.Emit(Expression node, CodeGenerator codeGenerator)
at PHP.Core.Compiler.AST.NodeCompilers.ValueAssignExCompiler.EmitSourceValRead(ValueAssignEx node, CodeGenerator codeGenerator)
at PHP.Core.Compiler.AST.NodeCompilers.ValueAssignExCompiler.Emit(AssignEx node, CodeGenerator codeGenerator)
at PHP.Core.Compiler.AST.NodeCompilers.ExpressionCompiler`1.PHP.Core.Compiler.AST.IExpressionCompiler.Emit(Expression node, CodeGenerator codeGenerator)
at PHP.Core.Compiler.AST.NodeCompilers.ExpressionStmtCompiler.Emit(ExpressionStmt node, CodeGenerator codeGenerator)
at PHP.Core.Compiler.AST.NodeCompilers.StatementCompiler`1.PHP.Core.Compiler.AST.IStatementCompiler.Emit(Statement node, CodeGenerator codeGenerator)
at PHP.Core.Compiler.AST.StatementUtils.Emit(IEnumerable`1 statements, CodeGenerator codeGenerator)
at PHP.Core.CodeGenerator.EmitArgfullOverloadBody(PhpRoutine routine, IEnumerable`1 body, Span entirePosition, Int32 declarationBodyPosition)
at PHP.Core.Compiler.AST.NodeCompilers.MethodDeclCompiler.Emit(MethodDecl node, CodeGenerator codeGenerator)
at PHP.Core.Compiler.AST.NodeCompilers.TypeMemberDeclCompiler`1.PHP.Core.Compiler.AST.ITypeMemberDeclCompiler.Emit(TypeMemberDecl node, CodeGenerator codeGenerator)
at PHP.Core.Compiler.AST.NodeCompilers.TypeDeclCompiler.EmitDefinition(CodeGenerator codeGenerator)
at PHP.Core.Compiler.AST.NodeCompilers.TypeDeclCompiler.Emit(TypeDecl node, CodeGenerator codeGenerator)
at PHP.Core.Compiler.AST.NodeCompilers.StatementCompiler`1.PHP.Core.Compiler.AST.IStatementCompiler.Emit(Statement node, CodeGenerator codeGenerator)
at PHP.Core.Compiler.AST.NodeCompilers.GlobalCodeCompiler.Emit(GlobalCode ast, CodeGenerator codeGenerator)
at PHP.Core.Reflection.CompilationSourceUnit.Emit(CodeGenerator codeGenerator)
at PHP.Core.Reflection.InclusionGraphBuilder.EmitAllUnits(CodeGenerator codeGenerator)
at PHP.Core.Emit.ScriptAssemblyBuilder.CompileScripts(IEnumerable`1 sourceFiles, CompilationContext context)
at PHP.Core.Emit.ScriptAssemblyBuilder.Build(IEnumerable`1 sourceFiles, CompilationContext context)
at PHP.Core.ApplicationCompiler.Compile(ApplicationContext applicationContext, CompilerConfiguration config, ErrorSink errorSink, CompilationParameters ps)
-1 0 WebApplication1

Re: Unexpected parent construct

PostPosted: October 17th, 2014, 1:13 pm
by Jakub Misek
Hi,

We've fixed compilation of create_function() and updated the preview version.

http://www.devsense.com/products/phalan ... ad/preview

Please let us know if there would be anything else.

Thanks,

Re: Unexpected parent construct

PostPosted: October 17th, 2014, 3:19 pm
by davidbcn
Still no luck, this project was compiling before..

Error 219 Internal error!
Please, report this bug via http://phalanger.codeplex.com/workitem/list/basic.
Additional information:
Method '__autoload#1' does not have a method body.
at System.Reflection.Emit.TypeBuilder.CreateTypeNoLock()
at System.Reflection.Emit.TypeBuilder.CreateType()
at PHP.Core.Emit.ScriptBuilder.Bake()
at PHP.Core.Emit.MultiScriptAssemblyBuilder.EmitAndBakeHelpers()
at PHP.Core.Emit.PhpAssemblyBuilder.Save()
at PHP.Core.ApplicationCompilerManager.Finish(Boolean successful)
at PHP.Core.Emit.ScriptAssemblyBuilder.CompileScripts(IEnumerable`1 sourceFiles, CompilationContext context)
at PHP.Core.Emit.ScriptAssemblyBuilder.Build(IEnumerable`1 sourceFiles, CompilationContext context)
at PHP.Core.ApplicationCompiler.Compile(ApplicationContext applicationContext, CompilerConfiguration config, ErrorSink errorSink, CompilationParameters ps)
-1 0 WebApplication1

Re: Unexpected parent construct

PostPosted: October 19th, 2014, 12:44 pm
by Jakub Misek
Hi,

There is an update containing latest Phalanger with conditional function declaration fix
http://www.devsense.com/products/phalan ... ad/preview

Thanks,