Remove {.constant.} pragma
Has not been allowed in Solidity since 0.5.0.
This commit is contained in:
parent
d4d0925c3e
commit
3505149381
|
@ -87,8 +87,6 @@ func isConstant(procedure: NimNode): bool =
|
||||||
return true
|
return true
|
||||||
elif pragma.eqIdent "pure":
|
elif pragma.eqIdent "pure":
|
||||||
return true
|
return true
|
||||||
elif pragma.eqIdent "constant":
|
|
||||||
return true
|
|
||||||
false
|
false
|
||||||
|
|
||||||
func addContractCall(procedure: var NimNode) =
|
func addContractCall(procedure: var NimNode) =
|
||||||
|
@ -123,7 +121,7 @@ func checkReturnType(procedure: NimNode) =
|
||||||
let returntype = procedure[3][0]
|
let returntype = procedure[3][0]
|
||||||
if returntype.kind != nnkEmpty and not procedure.isConstant:
|
if returntype.kind != nnkEmpty and not procedure.isConstant:
|
||||||
const message =
|
const message =
|
||||||
"only contract functions with {.constant.}, {.pure.} or {.view.} " &
|
"only contract functions with {.view.} or {.pure.} " &
|
||||||
"can have a return type"
|
"can have a return type"
|
||||||
error(message, returntype)
|
error(message, returntype)
|
||||||
|
|
||||||
|
@ -144,4 +142,3 @@ macro contract*(procedure: untyped{nkProcDef|nkMethodDef}): untyped =
|
||||||
|
|
||||||
template view* {.pragma.}
|
template view* {.pragma.}
|
||||||
template pure* {.pragma.}
|
template pure* {.pragma.}
|
||||||
template constant* {.pragma.}
|
|
||||||
|
|
Loading…
Reference in New Issue