예제 #1
0
		public BreakEffect  SimpleScoreVisualFX { get; set; } //defined in Constants.cs

		public StackObject (b2World world, 
		                    CCPoint location,
		                    string spriteFileName,
		                    bool breaksOnGround,
		                    bool breaksFromNinja,
		                    bool hasAnimatedBreakFrames,
		                    bool damagesEnemy,
		                    float density,
		                    CreationMethod createHow,
		                    int angleChange,
		                    bool makeImmovable,
		                    int points,
		                    BreakEffect simpleScoreVisualFXType)
		{
			InitWithWorld(world, 
			              location, 
			              spriteFileName, 
			              breaksOnGround,
			              breaksFromNinja,
			              hasAnimatedBreakFrames,
			              damagesEnemy,
			              density,
			              createHow,
			              angleChange,
			              makeImmovable,
			              points,
			              simpleScoreVisualFXType);
		}
예제 #2
0
        bool enemyCantBeDamagedForShortInterval; // after damage occurs the enemy gets a moment of un-damage-abilty, which should play better ( I think)


        public Enemy(b2World world,
                     CCPoint location,
                     string spriteFileName,
                     bool isTheRotationFixed,
                     bool getsDamageFromGround,
                     bool doesGetDamageFromDamageEnabledStackObjects,
                     int breaksFromHowMuchContact,
                     bool hasDifferentSpritesForDamage,
                     int numberOfFramesToAnimateOnBreak,
                     float density,
                     CreationMethod createHow,
                     int points,
                     BreakEffect simpleScoreVisualFXType)
        {
            InitWithWorld(world,
                          location,
                          spriteFileName,
                          isTheRotationFixed,
                          getsDamageFromGround,
                          doesGetDamageFromDamageEnabledStackObjects,
                          breaksFromHowMuchContact,
                          hasDifferentSpritesForDamage,
                          numberOfFramesToAnimateOnBreak,
                          density,
                          createHow,
                          points,
                          simpleScoreVisualFXType);
        }
예제 #3
0
        }                                                             //defined in Constants.cs

        public StackObject(b2World world,
                           CCPoint location,
                           string spriteFileName,
                           bool breaksOnGround,
                           bool breaksFromNinja,
                           bool hasAnimatedBreakFrames,
                           bool damagesEnemy,
                           float density,
                           CreationMethod createHow,
                           int angleChange,
                           bool makeImmovable,
                           int points,
                           BreakEffect simpleScoreVisualFXType)
        {
            InitWithWorld(world,
                          location,
                          spriteFileName,
                          breaksOnGround,
                          breaksFromNinja,
                          hasAnimatedBreakFrames,
                          damagesEnemy,
                          density,
                          createHow,
                          angleChange,
                          makeImmovable,
                          points,
                          simpleScoreVisualFXType);
        }
예제 #4
0
파일: EventManager.cs 프로젝트: Vinna/aura
 public CreationEventArgs(Creature creature, CreationMethod method, Item item, SkillRank rank)
 {
     this.Creature = creature;
     this.Method   = method;
     this.Item     = item;
     this.Rank     = rank;
 }
예제 #5
0
        public Enemy(b2World world,
		              CCPoint location,
		              string spriteFileName,
		              bool isTheRotationFixed,
		              bool getsDamageFromGround,
		              bool doesGetDamageFromDamageEnabledStackObjects,
		              int breaksFromHowMuchContact,
		              bool hasDifferentSpritesForDamage,
		              int numberOfFramesToAnimateOnBreak,
		              float density,
		              CreationMethod createHow,
		              int points,
		              BreakEffect simpleScoreVisualFXType )
        {
            InitWithWorld( world,
                           location,
                           spriteFileName,
                           isTheRotationFixed,
                           getsDamageFromGround,
                           doesGetDamageFromDamageEnabledStackObjects,
                           breaksFromHowMuchContact,
                           hasDifferentSpritesForDamage,
                           numberOfFramesToAnimateOnBreak,
                           density,
                           createHow,
                           points,
                           simpleScoreVisualFXType );
        }
예제 #6
0
        public void SetTooltip(string description, CreationMethod creationMethod = CreationMethod.Train)
        {
            var hotkey = _modification.GetModification(ModHotkey);
            var name   = _modification.GetModification(ModName);

            _modification.AddModification(new StringModification(ModTooltipBasic, $"[|cffffcc00{hotkey}|r] {creationMethod} {name}"));
            _modification.AddModification(new StringModification(ModTooltipExtended, description));
        }
예제 #7
0
        private List <ICreateObjects> GetInternalConstructors()
        {
            var constructorInfos = _typeInfo.GetConstructors(BindingFlags.Instance | BindingFlags.NonPublic);
            var enumerable       = constructorInfos.Where(CreationMethod.IsInternal);

            var wrappers = enumerable.Select(c => (ICreateObjects)CreationMethod.FromConstructorInfo(c)).ToList();

            return(wrappers);
        }
예제 #8
0
        void InitWithWorld(b2World world,
                            CCPoint location,
                            string spriteFileName,
                            bool isTheRotationFixed,
                            bool getsDamageFromGround,
                            bool doesGetDamageFromDamageEnabledStackObjects,
                            int breaksFromHowMuchContact,
                            bool hasDifferentSpritesForDamage,
                            int numberOfFramesToAnimateOnBreak,
                            float density,
                            CreationMethod createHow,
                            int points,
                            BreakEffect simpleScoreVisualFXType)
        {
            this.theWorld = world;
            this.initialLocation = location;
            this.baseImageName = spriteFileName;
            this.spriteImageName = String.Format("{0}", baseImageName);

            this.DamagesFromGroundContact = getsDamageFromGround; // does the ground break / damage the enemy

            this.damageLevel = 0; //starts at 0, if breaksAfterHowMuchContact also equals 0 then the enemy will break on first/next contact
            this.breaksAfterHowMuchContact = breaksFromHowMuchContact; //contact must be made this many times before breaking, or if set to 0, the enemy will break on first/next contact 
            this.differentSpritesForDamage = hasDifferentSpritesForDamage; //will progress through damage frames if this is YES, for example,  enemy_damage1.png, enemy_damage2.png

            this.currentFrame = 0;
            this.framesToAnimateOnBreak = numberOfFramesToAnimateOnBreak;  //will animate through breaks frames if this is more than 0, for example,  enemy_break0001.png, enemy_break0002.png


            this.theDensity = density;
            this.shapeCreationMethod = createHow;

            this.isRotationFixed = isTheRotationFixed;

            this.PointValue = points;
            this.SimpleScoreVisualFX = simpleScoreVisualFXType;

            this.DamagesFromDamageEnabledStackObjects = doesGetDamageFromDamageEnabledStackObjects;


            if (damageLevel == breaksAfterHowMuchContact)
            {
                BreaksOnNextDamage = true;
            }
            else
            {
                BreaksOnNextDamage = false; //duh

            }


            CreateEnemy();


        }
예제 #9
0
        void InitWithWorld(b2World world,
                           CCPoint location,
                           string spriteFileName,
                           bool isTheRotationFixed,
                           bool getsDamageFromGround,
                           bool doesGetDamageFromDamageEnabledStackObjects,
                           int breaksFromHowMuchContact,
                           bool hasDifferentSpritesForDamage,
                           int numberOfFramesToAnimateOnBreak,
                           float density,
                           CreationMethod createHow,
                           int points,
                           BreakEffect simpleScoreVisualFXType)
        {
            this.theWorld        = world;
            this.initialLocation = location;
            this.baseImageName   = spriteFileName;
            this.spriteImageName = String.Format("{0}.png", baseImageName);

            this.DamagesFromGroundContact = getsDamageFromGround;          // does the ground break / damage the enemy

            this.damageLevel = 0;                                          //starts at 0, if breaksAfterHowMuchContact also equals 0 then the enemy will break on first/next contact
            this.breaksAfterHowMuchContact = breaksFromHowMuchContact;     //contact must be made this many times before breaking, or if set to 0, the enemy will break on first/next contact
            this.differentSpritesForDamage = hasDifferentSpritesForDamage; //will progress through damage frames if this is YES, for example,  enemy_damage1.png, enemy_damage2.png

            this.currentFrame           = 0;
            this.framesToAnimateOnBreak = numberOfFramesToAnimateOnBreak;              //will animate through breaks frames if this is more than 0, for example,  enemy_break0001.png, enemy_break0002.png


            this.theDensity          = density;
            this.shapeCreationMethod = createHow;

            this.isRotationFixed = isTheRotationFixed;

            this.PointValue          = points;
            this.SimpleScoreVisualFX = simpleScoreVisualFXType;

            this.DamagesFromDamageEnabledStackObjects = doesGetDamageFromDamageEnabledStackObjects;


            if (damageLevel == breaksAfterHowMuchContact)
            {
                BreaksOnNextDamage = true;
            }
            else
            {
                BreaksOnNextDamage = false;                 //duh
            }


            CreateEnemy();
        }
예제 #10
0
		void InitWithWorld(b2World world, 
		                   CCPoint location,
		                   string spriteFileName,
		                   bool breaksOnGround,
		                   bool breaksFromNinja,
		                   bool hasAnimatedBreakFrames,
		                   bool damagesEnemy,
		                   float density,
		                   CreationMethod createHow,
		                   int angleChange,
		                   bool makeImmovable,
		                   int points,
		                   BreakEffect simpleScoreVisualFXType)
		{
			this.theWorld = world;
			this.initialLocation = location;
			this.baseImageName = spriteFileName;
			this.spriteImageName =  String.Format("{0}", baseImageName);
			
			this.IsBreaksOnGroundContact = breaksOnGround; 
			this.IsBreaksOnNinjaContact = breaksFromNinja; 
			this.addedAnimatedBreakFrames = hasAnimatedBreakFrames;
			this.IsCanDamageEnemy = damagesEnemy;
			this.theDensity = density;
			this.shapeCreationMethod = createHow;
			this.angle = angleChange;
			this.IsStatic = makeImmovable;
			
			this.currentFrame = 0;
			this.framesToAnimate = 10;
			
			this.PointValue = points ;
			this.SimpleScoreVisualFX = simpleScoreVisualFXType;
			
			CreateObject();
				
		}
예제 #11
0
        void InitWithWorld(b2World world,
                           CCPoint location,
                           string spriteFileName,
                           bool breaksOnGround,
                           bool breaksFromNinja,
                           bool hasAnimatedBreakFrames,
                           bool damagesEnemy,
                           float density,
                           CreationMethod createHow,
                           int angleChange,
                           bool makeImmovable,
                           int points,
                           BreakEffect simpleScoreVisualFXType)
        {
            this.theWorld        = world;
            this.initialLocation = location;
            this.baseImageName   = spriteFileName;
            this.spriteImageName = String.Format("{0}.png", baseImageName);

            this.IsBreaksOnGroundContact  = breaksOnGround;
            this.IsBreaksOnNinjaContact   = breaksFromNinja;
            this.addedAnimatedBreakFrames = hasAnimatedBreakFrames;
            this.IsCanDamageEnemy         = damagesEnemy;
            this.theDensity          = density;
            this.shapeCreationMethod = createHow;
            this.angle    = angleChange;
            this.IsStatic = makeImmovable;

            this.currentFrame    = 0;
            this.framesToAnimate = 10;

            this.PointValue          = points;
            this.SimpleScoreVisualFX = simpleScoreVisualFXType;

            CreateObject();
        }
예제 #12
0
        public override void visit_creation_method(CreationMethod m)
        {
            if (!m.coroutine)
            {
                base.visit_creation_method(m);
            }
            else
            {
                push_line(m.source_reference);

                bool visible = !m.is_private_symbol();

                visit_method(m);

                if (m.source_type == SourceFileType.FAST)
                {
                    return;
                }

                // do not generate _new functions for creation methods of abstract classes
                if (current_type_symbol is Class && !current_class.is_compact && !current_class.is_abstract)
                {
                    var vfunc = new CCodeFunction(get_ccode_name(m));

                    var cparam_map = new Dictionary <int, CCodeParameter>();
                    var carg_map   = new Dictionary <int, CCodeExpression>();

                    push_function(vfunc);

                    var vcall = new CCodeFunctionCall(new CCodeIdentifier(get_ccode_real_name(m)));
                    vcall.add_argument(new CCodeIdentifier(get_ccode_type_id(current_class)));

                    generate_cparameters(m, cfile, cparam_map, vfunc, null, carg_map, vcall, 1);
                    ccode.add_expression(vcall);

                    if (!visible)
                    {
                        vfunc.modifiers |= CCodeModifiers.STATIC;
                    }

                    pop_function();

                    cfile.add_function(vfunc);


                    vfunc = new CCodeFunction(get_ccode_finish_name(m));

                    cparam_map = new Dictionary <int, CCodeParameter>();
                    carg_map   = new Dictionary <int, CCodeExpression>();

                    push_function(vfunc);

                    vcall = new CCodeFunctionCall(new CCodeIdentifier(get_ccode_finish_real_name(m)));

                    generate_cparameters(m, cfile, cparam_map, vfunc, null, carg_map, vcall, 2);
                    ccode.add_return(vcall);

                    if (!visible)
                    {
                        vfunc.modifiers |= CCodeModifiers.STATIC;
                    }

                    pop_function();

                    cfile.add_function(vfunc);
                }

                pop_line();
            }
        }
예제 #13
0
 public override void visit_creation_method(CreationMethod m)
 {
     check_unused_attr(m);
     m.accept_children(this);
 }
예제 #14
0
 public List <CreationMethod> TryToObtainPublicConstructors()
 {
     return(_typeInfo.GetConstructors(BindingFlags.Public | BindingFlags.Instance)
            .Select(c => CreationMethod.FromConstructorInfo(c)).ToList());
 }
예제 #15
0
 public override void visit_creation_method(CreationMethod m)
 {
     visit_method(m);
 }
 public CreationMethodAttribute( CreationMethod creationMethod )
 {
     CreationMethod = creationMethod;
 }
예제 #17
0
 public override void visit_creation_method(CreationMethod m)
 {
     m.accept_children(this);
 }
예제 #18
0
 /// <summary>
 /// Visit operation called for creation methods.
 ///
 /// <param name="m">a method</param>
 /// </summary>
 public virtual void visit_creation_method(CreationMethod m)
 {
 }
예제 #19
0
        public override bool check(CodeContext context)
        {
            if (is_checked)
            {
                return(!error);
            }

            is_checked = true;

            if (!call.check(context))
            {
                /* if method resolving didn't succeed, skip this check */
                error = true;
                return(false);
            }

            // type of target object
            DataType target_object_type = null;

            List <DataType> method_type_args = null;

            if (call.value_type is DelegateType)
            {
                // delegate invocation, resolve generic types relative to delegate
                target_object_type = call.value_type;
            }
            else if (call is MemberAccess)
            {
                var ma = (MemberAccess)call;
                if (ma.prototype_access)
                {
                    error = true;
                    Report.error(source_reference, "Access to instance member `%s' denied".printf(call.symbol_reference.get_full_name()));
                    return(false);
                }

                method_type_args = ma.get_type_arguments();

                if (ma.inner != null)
                {
                    target_object_type = ma.inner.value_type;

                    // foo is relevant instance in foo.bar.connect (on_bar)
                    if (ma.inner.symbol_reference is Signal)
                    {
                        var sig = ma.inner as MemberAccess;
                        if (sig != null)
                        {
                            target_object_type = sig.inner.value_type;
                        }
                    }

                    // foo is relevant instance in foo.bar.begin (bar_ready) and foo.bar.end (result)
                    var m = ma.symbol_reference as Method;
                    if (m != null && m.coroutine)
                    {
                        // begin or end call of async method
                        if (ma.member_name == "begin" || ma.member_name == "end")
                        {
                            var method_access = ma.inner as MemberAccess;
                            if (method_access != null && method_access.inner != null)
                            {
                                target_object_type = method_access.inner.value_type;
                            }
                            else
                            {
                                // static method
                                target_object_type = null;
                            }
                        }
                    }
                }

                if (ma.symbol_reference != null && ma.symbol_reference.get_attribute("Assert") != null)
                {
                    this.is_assert = true;

                    var _args = get_argument_list();
                    if (_args.Count == 1)
                    {
                        this.source_reference = _args[0].source_reference;
                    }
                }
            }

            var mtype           = call.value_type;
            var gobject_chainup = call.symbol_reference == context.analyzer.object_type;

            is_chainup = gobject_chainup;

            if (!gobject_chainup)
            {
                var expr = call;
                var ma   = expr as MemberAccess;
                if (ma != null && ma.symbol_reference is CreationMethod)
                {
                    expr = ma.inner;
                    ma   = expr as MemberAccess;
                }
                if (ma != null && ma.member_name == "this")
                {
                    // this[.with_foo] ()
                    is_chainup = true;
                }
                else if (expr is BaseAccess)
                {
                    // base[.with_foo] ()
                    is_chainup = true;
                }
            }

            CreationMethod base_cm = null;

            if (is_chainup)
            {
                var cm = context.analyzer.find_current_method() as CreationMethod;
                if (cm == null)
                {
                    error = true;
                    Report.error(source_reference, "invocation not supported in this context");
                    return(false);
                }
                else if (cm.chain_up)
                {
                    error = true;
                    Report.error(source_reference, "Multiple constructor calls in the same constructor are not permitted");
                    return(false);
                }
                cm.chain_up = true;

                if (mtype is ObjectType)
                {
                    var otype = (ObjectType)mtype;
                    var cl    = (Class)otype.type_symbol;
                    base_cm = cl.default_construction_method;
                    if (base_cm == null)
                    {
                        error = true;
                        Report.error(source_reference, "chain up to `%s' not supported".printf(cl.get_full_name()));
                        return(false);
                    }
                    else if (!base_cm.has_construct_function)
                    {
                        error = true;
                        Report.error(source_reference, "chain up to `%s' not supported".printf(base_cm.get_full_name()));
                        return(false);
                    }
                }
                else if (call.symbol_reference is CreationMethod && call.symbol_reference.parent_symbol is Class)
                {
                    base_cm = (CreationMethod)call.symbol_reference;
                    if (!base_cm.has_construct_function)
                    {
                        error = true;
                        Report.error(source_reference, "chain up to `%s' not supported".printf(base_cm.get_full_name()));
                        return(false);
                    }
                }
                else if (gobject_chainup)
                {
                    var cl = cm.parent_symbol as Class;
                    if (cl == null || !cl.is_subtype_of(context.analyzer.object_type))
                    {
                        error = true;
                        Report.error(source_reference, "chain up to `GLib.Object' not supported");
                        return(false);
                    }
                    call.value_type = new ObjectType(context.analyzer.object_type);
                    mtype           = call.value_type;
                }
            }

            // check for struct construction
            if (call is MemberAccess &&
                ((call.symbol_reference is CreationMethod &&
                  call.symbol_reference.parent_symbol is Struct) ||
                 call.symbol_reference is Struct))
            {
                var st = call.symbol_reference as Struct;
                if (st != null && st.default_construction_method == null && (st.is_boolean_type() || st.is_integer_type() || st.is_floating_type()))
                {
                    error = true;
                    Report.error(source_reference, "invocation not supported in this context");
                    return(false);
                }

                var struct_creation_expression = new ObjectCreationExpression((MemberAccess)call, source_reference);
                struct_creation_expression.struct_creation = true;
                foreach (Expression arg in get_argument_list())
                {
                    struct_creation_expression.add_argument(arg);
                }
                struct_creation_expression.target_type = target_type;
                context.analyzer.replaced_nodes.Add(this);
                parent_node.replace_expression(this, struct_creation_expression);
                struct_creation_expression.check(context);
                return(true);
            }
            else if (!is_chainup && call is MemberAccess && call.symbol_reference is CreationMethod)
            {
                error = true;
                Report.error(source_reference, "use `new' operator to create new objects");
                return(false);
            }

            if (!is_chainup && mtype is ObjectType)
            {
                // prevent funny stuff like (new Object ()) ()
                error = true;
                Report.error(source_reference, "invocation not supported in this context");
                return(false);
            }
            else if (mtype != null && mtype.is_invokable())
            {
                // call ok, expression is invokable
            }
            else if (call.symbol_reference is Class)
            {
                error = true;
                Report.error(source_reference, "use `new' operator to create new objects");
                return(false);
            }
            else
            {
                error = true;
                Report.error(source_reference, "invocation not supported in this context");
                return(false);
            }

            var ret_type = mtype.get_return_type();
            var _params  = mtype.get_parameters();

            if (mtype is MethodType)
            {
                var m = ((MethodType)mtype).method_symbol;
                if (m != null && m.coroutine)
                {
                    var ma = (MemberAccess)call;
                    if (!is_yield_expression)
                    {
                        // begin or end call of async method
                        if (ma.member_name != "end")
                        {
                            // begin (possibly implicit)
                            if (ma.member_name != "begin")
                            {
                                Report.deprecated(ma.source_reference, "implicit .begin is deprecated");
                            }
                            _params  = m.get_async_begin_parameters();
                            ret_type = new VoidType();
                        }
                        else
                        {
                            // end
                            _params = m.get_async_end_parameters();
                        }
                    }
                    else if (ma.member_name == "begin" || ma.member_name == "end")
                    {
                        error = true;
                        Report.error(ma.source_reference, "use of `%s' not allowed in yield statement".printf(ma.member_name));
                    }
                }

                if (m != null)
                {
                    var ma            = (MemberAccess)call;
                    int n_type_params = m.get_type_parameters().Count;
                    int n_type_args   = ma.get_type_arguments().Count;
                    if (n_type_args > 0 && n_type_args < n_type_params)
                    {
                        error = true;
                        Report.error(ma.source_reference, "too few type arguments");
                        return(false);
                    }
                    else if (n_type_args > 0 && n_type_args > n_type_params)
                    {
                        error = true;
                        Report.error(ma.source_reference, "too many type arguments");
                        return(false);
                    }
                }
            }

            // FIXME partial code duplication in ObjectCreationExpression.check

            Expression last_arg = null;

            var args = get_argument_list();
            IEnumerator <Expression> arg_it = args.GetEnumerator();

            foreach (Parameter param in _params)
            {
                if (param.ellipsis)
                {
                    break;
                }

                if (param.params_array)
                {
                    var array_type = (ArrayType)param.variable_type;
                    while (arg_it.MoveNext())
                    {
                        Expression arg = arg_it.Current;

                        /* store expected type for callback parameters */
                        arg.target_type             = array_type.element_type;
                        arg.target_type.value_owned = array_type.value_owned;
                    }
                    break;
                }

                if (arg_it.MoveNext())
                {
                    Expression arg = arg_it.Current;

                    /* store expected type for callback parameters */
                    arg.formal_target_type = param.variable_type;
                    arg.target_type        = arg.formal_target_type.get_actual_type(target_object_type, method_type_args, this);

                    last_arg = arg;
                }
            }

            // concatenate stringified arguments for methods with attribute [Print]
            if (mtype is MethodType && ((MethodType)mtype).method_symbol.get_attribute("Print") != null)
            {
                var template = new Template(source_reference);
                foreach (Expression arg in argument_list)
                {
                    arg.parent_node = null;
                    template.add_expression(arg);
                }
                argument_list.Clear();
                add_argument(template);
            }

            // printf arguments
            if (mtype is MethodType && ((MethodType)mtype).method_symbol.printf_format)
            {
                StringLiteral format_literal = null;
                if (last_arg != null)
                {
                    // use last argument as format string
                    format_literal = StringLiteral.get_format_literal(last_arg);
                    if (format_literal == null && args.Count == _params.Count - 1)
                    {
                        // insert "%s" to avoid issues with embedded %
                        format_literal             = new StringLiteral("\"%s\"");
                        format_literal.target_type = context.analyzer.string_type.copy();
                        argument_list.Insert(args.Count - 1, format_literal);

                        // recreate iterator and skip to right position
                        arg_it = argument_list.GetEnumerator();
                        foreach (Parameter param in _params)
                        {
                            if (param.ellipsis)
                            {
                                break;
                            }
                            arg_it.MoveNext();
                        }
                    }
                }
                else
                {
                    // use instance as format string for string.printf (...)
                    var ma = call as MemberAccess;
                    if (ma != null)
                    {
                        format_literal = StringLiteral.get_format_literal(ma.inner);
                    }
                }
                if (format_literal != null)
                {
                    string format = format_literal.eval();
                    if (!context.analyzer.check_print_format(format, arg_it, source_reference))
                    {
                        return(false);
                    }
                }
            }

            foreach (Expression arg in get_argument_list().ToList())
            {
                arg.check(context);
            }

            if (ret_type is VoidType)
            {
                // void return type
                if (!(parent_node is ExpressionStatement) &&
                    !(parent_node is ForStatement) &&
                    !(parent_node is YieldStatement))
                {
                    // A void method invocation can be in the initializer or
                    // iterator of a for statement
                    error = true;
                    Report.error(source_reference, "invocation of void method not allowed as expression");
                    return(false);
                }
            }

            formal_value_type = ret_type.copy();
            value_type        = formal_value_type.get_actual_type(target_object_type, method_type_args, this);

            bool may_throw = false;

            if (mtype is MethodType)
            {
                var m = ((MethodType)mtype).method_symbol;
                if (is_yield_expression)
                {
                    if (!m.coroutine)
                    {
                        error = true;
                        Report.error(source_reference, "yield expression requires async method");
                    }
                    if (context.analyzer.current_method == null || !context.analyzer.current_method.coroutine)
                    {
                        error = true;
                        Report.error(source_reference, "yield expression not available outside async method");
                    }
                }
                if (m != null && m.coroutine && !is_yield_expression && ((MemberAccess)call).member_name != "end")
                {
                    // .begin call of async method, no error can happen here
                }
                else
                {
                    foreach (DataType error_type in m.get_error_types())
                    {
                        may_throw = true;

                        // ensure we can trace back which expression may throw errors of this type
                        var call_error_type = error_type.copy();
                        call_error_type.source_reference = source_reference;

                        add_error_type(call_error_type);
                    }
                }
                if (m.returns_floating_reference)
                {
                    value_type.floating_reference = true;
                }
                if (m.returns_modified_pointer)
                {
                    ((MemberAccess)call).inner.lvalue = true;
                }

                var dynamic_sig = m.parent_symbol as DynamicSignal;
                if (dynamic_sig != null && dynamic_sig.handler != null)
                {
                    dynamic_sig.return_type = dynamic_sig.handler.value_type.get_return_type().copy();
                    bool first = true;
                    foreach (Parameter param in dynamic_sig.handler.value_type.get_parameters())
                    {
                        if (first)
                        {
                            // skip sender parameter
                            first = false;
                        }
                        else
                        {
                            dynamic_sig.add_parameter(param.copy());
                        }
                    }
                    dynamic_sig.handler.target_type = new DelegateType(dynamic_sig.get_delegate(new ObjectType((ObjectTypeSymbol)dynamic_sig.parent_symbol), this));
                }

                if (m != null && m.get_type_parameters().Count > 0)
                {
                    var ma = (MemberAccess)call;
                    if (ma.get_type_arguments().Count == 0)
                    {
                        // infer type arguments
                        foreach (var type_param in m.get_type_parameters())
                        {
                            DataType type_arg = null;

                            // infer type arguments from arguments
                            arg_it = args.GetEnumerator();
                            foreach (Parameter param in _params)
                            {
                                if (param.ellipsis || param.params_array)
                                {
                                    break;
                                }

                                if (arg_it.MoveNext())
                                {
                                    Expression arg = arg_it.Current;

                                    type_arg = param.variable_type.infer_type_argument(type_param, arg.value_type);
                                    if (type_arg != null)
                                    {
                                        break;
                                    }

                                    arg.target_type = arg.formal_target_type.get_actual_type(target_object_type, method_type_args, this);
                                }
                            }

                            // infer type arguments from expected return type
                            if (type_arg == null && target_type != null)
                            {
                                type_arg = m.return_type.infer_type_argument(type_param, target_type);
                            }

                            if (type_arg == null)
                            {
                                error = true;
                                Report.error(ma.source_reference, "cannot infer generic type argument for type parameter `%s'".printf(type_param.get_full_name()));
                                return(false);
                            }

                            ma.add_type_argument(type_arg);
                        }

                        // recalculate argument target types with new information
                        arg_it = args.GetEnumerator();
                        foreach (Parameter param in _params)
                        {
                            if (param.ellipsis || param.params_array)
                            {
                                break;
                            }

                            if (arg_it.MoveNext())
                            {
                                Expression arg = arg_it.Current;

                                arg.target_type = arg.formal_target_type.get_actual_type(target_object_type, method_type_args, this);
                            }
                        }

                        // recalculate return value type with new information
                        value_type = formal_value_type.get_actual_type(target_object_type, method_type_args, this);
                    }
                }
                // replace method-type if needed for proper argument-check in semantic-analyser
                if (m != null && m.coroutine)
                {
                    var ma = (MemberAccess)call;
                    if (ma.member_name == "end")
                    {
                        mtype = new MethodType(m.get_end_method());
                    }
                }
            }
            else if (mtype is ObjectType)
            {
                // constructor
                var cl = (Class)((ObjectType)mtype).type_symbol;
                var m  = cl.default_construction_method;
                foreach (DataType error_type in m.get_error_types())
                {
                    may_throw = true;

                    // ensure we can trace back which expression may throw errors of this type
                    var call_error_type = error_type.copy();
                    call_error_type.source_reference = source_reference;

                    add_error_type(call_error_type);
                }
            }
            else if (mtype is DelegateType)
            {
                var d = ((DelegateType)mtype).delegate_symbol;
                foreach (DataType error_type in d.get_error_types())
                {
                    may_throw = true;

                    // ensure we can trace back which expression may throw errors of this type
                    var call_error_type = error_type.copy();
                    call_error_type.source_reference = source_reference;

                    add_error_type(call_error_type);
                }
            }

            if (!context.analyzer.check_arguments(this, mtype, _params, get_argument_list()))
            {
                error = true;
                return(false);
            }

            /* Check for constructv chain up */
            if (base_cm != null && base_cm.is_variadic() && args.Count == base_cm.get_parameters().Count)
            {
                var this_last_arg = args[args.Count - 1];
                if (this_last_arg.value_type is StructValueType && this_last_arg.value_type.data_type == context.analyzer.va_list_type.data_type)
                {
                    is_constructv_chainup = true;
                }
            }

            if (may_throw)
            {
                if (parent_node is LocalVariable || parent_node is ExpressionStatement)
                {
                    // simple statements, no side effects after method call
                }
                else if (!(context.analyzer.current_symbol is Block))
                {
                    // can't handle errors in field initializers
                    Report.error(source_reference, "Field initializers must not throw errors");
                }
                else
                {
                    // store parent_node as we need to replace the expression in the old parent node later on
                    var old_parent_node = parent_node;

                    var local = new LocalVariable(value_type.copy(), get_temp_name(), null, source_reference);
                    var decl  = new DeclarationStatement(local, source_reference);

                    insert_statement(context.analyzer.insert_block, decl);

                    var temp_access = SemanticAnalyzer.create_temp_access(local, target_type);

                    // don't set initializer earlier as this changes parent_node and parent_statement
                    local.initializer = this;
                    decl.check(context);


                    // move temp variable to insert block to ensure the
                    // variable is in the same block as the declaration
                    // otherwise there will be scoping issues in the generated code
                    var block = (Block)context.analyzer.current_symbol;
                    block.remove_local_variable(local);
                    context.analyzer.insert_block.add_local_variable(local);

                    old_parent_node.replace_expression(this, temp_access);
                    temp_access.check(context);
                }
            }

            return(!error);
        }