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

Commit

Permalink
issue #166 - also consider Operations
Browse files Browse the repository at this point in the history
  • Loading branch information
flantony committed Oct 12, 2018
1 parent 0366398 commit 493555d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"object":"608060405234801561001057600080fd5b5060b78061001f6000396000f300608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680637d74f815146044575b600080fd5b348015604f57600080fd5b50607b600480360381019080803560030b9060200190929190803515159060200190929190505050607d565b005b608760056000607d565b50505600a165627a7a72305820b146779f5c01efe51abb0752b5bfbfd7f9075dbcd7c821639596d8814911cb290029","opcodes":"PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0xB7 DUP1 PUSH2 0x1F PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH1 0x3F JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH4 0x7D74F815 EQ PUSH1 0x44 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH1 0x4F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x7B PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH1 0x3 SIGNEXTEND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD ISZERO ISZERO SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH1 0x7D JUMP JUMPDEST STOP JUMPDEST PUSH1 0x87 PUSH1 0x5 PUSH1 0x0 PUSH1 0x7D JUMP JUMPDEST POP POP JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 0xb1 0x46 PUSH24 0x9F5C01EFE51ABB0752B5BFBFD7F9075DBCD7C821639596D8 DUP2 0x49 GT 0xcb 0x29 STOP 0x29 ","sourceMap":"28:117:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;28:117:0;;;;;;;"}
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ public class ReferenceExamplesTest {
, "VestedToken.sol"
, "Shareable.sol"
, "provider.sol"
, "73_named_parameter_calls.sol"

);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import com.google.inject.Inject
import com.yakindu.solidity.solidity.AddressLiteral
import com.yakindu.solidity.solidity.DecimalNumberLiteral
import com.yakindu.solidity.solidity.FunctionDefinition
import com.yakindu.solidity.solidity.MappingTypeSpecifier
import com.yakindu.solidity.solidity.NewInstanceExpression
import com.yakindu.solidity.solidity.NumericalMultiplyDivideExpression
import com.yakindu.solidity.solidity.VariableDefinition
Expand All @@ -27,12 +28,12 @@ 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

import static org.yakindu.base.types.typesystem.ITypeSystem.REAL
import com.yakindu.solidity.solidity.MappingTypeSpecifier

/**
*
Expand Down Expand Up @@ -97,9 +98,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 493555d

Please sign in to comment.