Skip to content

Commit f08e1d9

Browse files
authored
This behaviour was left after we removed the explicitTypes option (#929)
1 parent 2c8b7eb commit f08e1d9

2 files changed

Lines changed: 8 additions & 15 deletions

File tree

src/parser.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,6 @@ function parse(text, _parsers, options = _parsers) {
6161
? `hex'${ctx.value.slice(4, -1)}'`
6262
: `hex"${ctx.value.slice(4, -1)}"`;
6363
},
64-
ElementaryTypeName(ctx) {
65-
// if the compiler is below 0.8.0 we will recognize the type 'byte' as an
66-
// alias of 'bytes1'. Otherwise we will ignore this and enforce always
67-
// 'bytes1'.
68-
const pre080 = compiler && satisfies(compiler, '<0.8.0');
69-
if (!pre080 && ctx.name === 'byte') ctx.name = 'bytes1';
70-
},
7164
BinaryOperation(ctx) {
7265
switch (ctx.operator) {
7366
case '+':

tests/format/BreakingChangesV0.8.0/__snapshots__/jsfmt.spec.js.snap

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -158,16 +158,16 @@ contract BreakingChangesV080 {
158158
* use of bytes1.
159159
*/
160160
bytes1 public c;
161-
bytes1 public g;
161+
byte public g;
162162
163163
struct S {
164164
bytes1 c;
165-
bytes1 g;
165+
byte g;
166166
}
167167
168-
event Event(bytes1 _c, bytes1 _g);
168+
event Event(bytes1 _c, byte _g);
169169
170-
function func(bytes1 _c, bytes1 _g) public returns (bytes1, bytes1) {
170+
function func(bytes1 _c, byte _g) public returns (bytes1, byte) {
171171
emit Event(_c, _g);
172172
return (_c, _g);
173173
}
@@ -245,16 +245,16 @@ contract BreakingChangesV080 {
245245
* use of bytes1.
246246
*/
247247
bytes1 public c;
248-
bytes1 public g;
248+
byte public g;
249249
250250
struct S {
251251
bytes1 c;
252-
bytes1 g;
252+
byte g;
253253
}
254254
255-
event Event(bytes1 _c, bytes1 _g);
255+
event Event(bytes1 _c, byte _g);
256256
257-
function func(bytes1 _c, bytes1 _g) public returns (bytes1, bytes1) {
257+
function func(bytes1 _c, byte _g) public returns (bytes1, byte) {
258258
emit Event(_c, _g);
259259
return (_c, _g);
260260
}

0 commit comments

Comments
 (0)