Skip to content
This repository has been archived by the owner on Jul 2, 2021. It is now read-only.

Commit

Permalink
Merge pull request #184 from Yakindu/issue_166
Browse files Browse the repository at this point in the history
issue #166 - also consider Operations
  • Loading branch information
flantony committed Oct 23, 2018
2 parents 08dfa7c + b8bfa74 commit 8690db4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pragma solidity ^0.4.25;

contract NamedParameter{
function callMe(int32 i, bool b) public{
callMe({b : false, i : 5});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ public class ReferenceExamplesTest {
, "RefundableCrowdsale.sol"
, "MultisigWallet.sol"
, "VestedToken.sol"
, "73_named_parameter_calls.sol"
, "179_gas_value.sol"

);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import org.yakindu.base.expressions.expressions.BoolLiteral
import org.yakindu.base.expressions.expressions.ElementReferenceExpression
import org.yakindu.base.expressions.expressions.FeatureCall
import org.yakindu.base.expressions.inferrer.ExpressionsTypeInferrer
import org.yakindu.base.types.Operation
import org.yakindu.base.types.Type
import org.yakindu.base.types.TypedElement
import org.yakindu.base.types.typesystem.ITypeSystem
Expand Down Expand Up @@ -115,9 +116,11 @@ class SolidityTypeInferrer extends ExpressionsTypeInferrer {

// Type Cast
override doInfer(ElementReferenceExpression e) {
if (e.isOperationCall() && (e.reference instanceof Type)) {
if (e.isOperationCall() && ((e.reference instanceof Type)|| e.reference instanceof Operation)) {
return inferTypeDispatch(e.reference)
}


return super.doInfer(e)
}

Expand Down

0 comments on commit 8690db4

Please sign in to comment.