mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Replace hard-coded types with __builtin()
This commit is contained in:
@@ -1,5 +1,15 @@
|
||||
pragma experimental solidity;
|
||||
|
||||
type void = __builtin("void");
|
||||
|
||||
type bool = __builtin("bool");
|
||||
type word = __builtin("word");
|
||||
type integer = __builtin("integer");
|
||||
type unit = __builtin("unit");
|
||||
|
||||
type fun(T, U) = __builtin("fun");
|
||||
type pair(T, U) = __builtin("pair");
|
||||
|
||||
contract C {
|
||||
fallback() external {
|
||||
let v: void;
|
||||
@@ -23,45 +33,58 @@ contract C {
|
||||
// EVMVersion: >=constantinople
|
||||
// ----
|
||||
// Warning 2264: (0-29): Experimental features are turned on. Do not use experimental features on live deployments.
|
||||
// Info 4164: (48-348): Inferred type: () -> ()
|
||||
// Info 4164: (56-58): Inferred type: ()
|
||||
// Info 4164: (82-89): Inferred type: void
|
||||
// Info 4164: (85-89): Inferred type: void
|
||||
// Info 4164: (104-111): Inferred type: bool
|
||||
// Info 4164: (107-111): Inferred type: bool
|
||||
// Info 4164: (121-142): Inferred type: bool
|
||||
// Info 4164: (121-129): Inferred type: word -> bool
|
||||
// Info 4164: (121-125): Inferred type: bool
|
||||
// Info 4164: (130-141): Inferred type: word
|
||||
// Info 4164: (130-138): Inferred type: bool -> word
|
||||
// Info 4164: (130-134): Inferred type: bool
|
||||
// Info 4164: (139-140): Inferred type: bool
|
||||
// Info 4164: (157-164): Inferred type: word
|
||||
// Info 4164: (160-164): Inferred type: word
|
||||
// Info 4164: (178-188): Inferred type: integer
|
||||
// Info 4164: (181-188): Inferred type: integer
|
||||
// Info 4164: (202-209): Inferred type: ()
|
||||
// Info 4164: (205-209): Inferred type: ()
|
||||
// Info 4164: (224-242): Inferred type: word -> bool
|
||||
// Info 4164: (227-242): Inferred type: word -> bool
|
||||
// Info 4164: (227-230): Inferred type: tfun((word, bool), word -> bool)
|
||||
// Info 4164: (231-235): Inferred type: word
|
||||
// Info 4164: (237-241): Inferred type: bool
|
||||
// Info 4164: (252-260): Inferred type: bool
|
||||
// Info 4164: (252-253): Inferred type: bool
|
||||
// Info 4164: (256-260): Inferred type: bool
|
||||
// Info 4164: (256-257): Inferred type: word -> bool
|
||||
// Info 4164: (258-259): Inferred type: word
|
||||
// Info 4164: (275-294): Inferred type: (bool, word)
|
||||
// Info 4164: (278-294): Inferred type: (bool, word)
|
||||
// Info 4164: (278-282): Inferred type: tfun((bool, word), (bool, word))
|
||||
// Info 4164: (283-287): Inferred type: bool
|
||||
// Info 4164: (289-293): Inferred type: word
|
||||
// Info 4164: (304-317): Inferred type: bool
|
||||
// Info 4164: (304-314): Inferred type: (bool, word) -> bool
|
||||
// Info 4164: (304-308): Inferred type: ('bh:type, 'bi:type)
|
||||
// Info 4164: (315-316): Inferred type: (bool, word)
|
||||
// Info 4164: (327-341): Inferred type: word
|
||||
// Info 4164: (327-338): Inferred type: (bool, word) -> word
|
||||
// Info 4164: (327-331): Inferred type: ('bn:type, 'bo:type)
|
||||
// Info 4164: (339-340): Inferred type: (bool, word)
|
||||
// Info 4164: (31-61): Inferred type: void
|
||||
// Info 4164: (63-93): Inferred type: bool
|
||||
// Info 4164: (94-124): Inferred type: word
|
||||
// Info 4164: (125-161): Inferred type: integer
|
||||
// Info 4164: (162-192): Inferred type: ()
|
||||
// Info 4164: (194-228): Inferred type: tfun(('u:type, 'v:type), 'u:type -> 'v:type)
|
||||
// Info 4164: (202-208): Inferred type: ('s:type, 't:type)
|
||||
// Info 4164: (203-204): Inferred type: 's:type
|
||||
// Info 4164: (206-207): Inferred type: 't:type
|
||||
// Info 4164: (229-265): Inferred type: tfun(('y:type, 'z:type), ('y:type, 'z:type))
|
||||
// Info 4164: (238-244): Inferred type: ('w:type, 'x:type)
|
||||
// Info 4164: (239-240): Inferred type: 'w:type
|
||||
// Info 4164: (242-243): Inferred type: 'x:type
|
||||
// Info 4164: (284-584): Inferred type: () -> ()
|
||||
// Info 4164: (292-294): Inferred type: ()
|
||||
// Info 4164: (318-325): Inferred type: void
|
||||
// Info 4164: (321-325): Inferred type: void
|
||||
// Info 4164: (340-347): Inferred type: bool
|
||||
// Info 4164: (343-347): Inferred type: bool
|
||||
// Info 4164: (357-378): Inferred type: bool
|
||||
// Info 4164: (357-365): Inferred type: word -> bool
|
||||
// Info 4164: (357-361): Inferred type: bool
|
||||
// Info 4164: (366-377): Inferred type: word
|
||||
// Info 4164: (366-374): Inferred type: bool -> word
|
||||
// Info 4164: (366-370): Inferred type: bool
|
||||
// Info 4164: (375-376): Inferred type: bool
|
||||
// Info 4164: (393-400): Inferred type: word
|
||||
// Info 4164: (396-400): Inferred type: word
|
||||
// Info 4164: (414-424): Inferred type: integer
|
||||
// Info 4164: (417-424): Inferred type: integer
|
||||
// Info 4164: (438-445): Inferred type: ()
|
||||
// Info 4164: (441-445): Inferred type: ()
|
||||
// Info 4164: (460-478): Inferred type: word -> bool
|
||||
// Info 4164: (463-478): Inferred type: word -> bool
|
||||
// Info 4164: (463-466): Inferred type: tfun((word, bool), word -> bool)
|
||||
// Info 4164: (467-471): Inferred type: word
|
||||
// Info 4164: (473-477): Inferred type: bool
|
||||
// Info 4164: (488-496): Inferred type: bool
|
||||
// Info 4164: (488-489): Inferred type: bool
|
||||
// Info 4164: (492-496): Inferred type: bool
|
||||
// Info 4164: (492-493): Inferred type: word -> bool
|
||||
// Info 4164: (494-495): Inferred type: word
|
||||
// Info 4164: (511-530): Inferred type: (bool, word)
|
||||
// Info 4164: (514-530): Inferred type: (bool, word)
|
||||
// Info 4164: (514-518): Inferred type: tfun((bool, word), (bool, word))
|
||||
// Info 4164: (519-523): Inferred type: bool
|
||||
// Info 4164: (525-529): Inferred type: word
|
||||
// Info 4164: (540-553): Inferred type: bool
|
||||
// Info 4164: (540-550): Inferred type: (bool, word) -> bool
|
||||
// Info 4164: (540-544): Inferred type: ('cb:type, 'cc:type)
|
||||
// Info 4164: (551-552): Inferred type: (bool, word)
|
||||
// Info 4164: (563-577): Inferred type: word
|
||||
// Info 4164: (563-574): Inferred type: (bool, word) -> word
|
||||
// Info 4164: (563-567): Inferred type: ('ci:type, 'cj:type)
|
||||
// Info 4164: (575-576): Inferred type: (bool, word)
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
pragma experimental solidity;
|
||||
|
||||
type someUnknownType = __builtin("someUnknownType");
|
||||
// ====
|
||||
// EVMVersion: >=constantinople
|
||||
// ----
|
||||
// Warning 2264: (0-29): Experimental features are turned on. Do not use experimental features on live deployments.
|
||||
// TypeError 7758: (31-81): Expected the name of a built-in primitive type.
|
||||
Reference in New Issue
Block a user