Updates syntax tests to specify default visibility.

This commit is contained in:
Erik Kundt 2018-06-29 14:55:44 +02:00
parent e289c36158
commit f3ca0685fe
45 changed files with 138 additions and 196 deletions

View File

@ -1,6 +1,4 @@
contract C {
// Check that visibility is also enforced for the fallback function.
function() {}
function() public {}
}
// ----
// Warning: (90-103): No visibility specified. Defaulting to "public".

View File

@ -3,10 +3,8 @@ pragma experimental ABIEncoderV2;
contract C {
struct S1 { function() external a; }
struct S2 { bytes24 a; }
function f(S1) pure {}
function f(S2) pure {}
function f(S1) public pure {}
function f(S2) public pure {}
}
// ----
// Warning: (0-33): Experimental features are turned on. Do not use experimental features on live deployments.
// Warning: (122-144): No visibility specified. Defaulting to "public".
// Warning: (149-171): No visibility specified. Defaulting to "public".

View File

@ -1,10 +1,8 @@
contract test {
enum ActionChoices { GoLeft, GoRight, GoStraight, Sit }
constructor()
constructor() public
{
choices = ActionChoices.GoStraight;
}
ActionChoices choices;
}
// ----
// Warning: (80-149): No visibility specified. Defaulting to "public".

View File

@ -1,7 +1,7 @@
contract C {
function three() public returns (uint, uint, uint);
function two() public returns (uint, uint);
function none();
function none() public;
function f() public {
(uint a,) = three();
(uint b, uint c,) = two();
@ -13,8 +13,7 @@ contract C {
}
}
// ----
// Warning: (172-191): Different number of components on the left hand side (2) than on the right hand side (3).
// Warning: (201-226): Different number of components on the left hand side (3) than on the right hand side (2).
// Warning: (236-255): Different number of components on the left hand side (2) than on the right hand side (3).
// Warning: (265-290): Different number of components on the left hand side (3) than on the right hand side (2).
// Warning: (121-137): No visibility specified. Defaulting to "public".
// Warning: (179-198): Different number of components on the left hand side (2) than on the right hand side (3).
// Warning: (208-233): Different number of components on the left hand side (3) than on the right hand side (2).
// Warning: (243-262): Different number of components on the left hand side (2) than on the right hand side (3).
// Warning: (272-297): Different number of components on the left hand side (3) than on the right hand side (2).

View File

@ -1,7 +1,4 @@
contract M {
function f(uint[]);
function f(int[]);
}
// ----
// Warning: (25-44): No visibility specified. Defaulting to "public".
// Warning: (53-71): No visibility specified. Defaulting to "public".
contract M {
function f(uint[]) public;
function f(int[]) public;
}

View File

@ -3,11 +3,10 @@ contract C {
uint a;
string b;
}
function f() {
function f() public {
S[2] memory x = [S({a: 1, b: "fish"}), S({a: 2, b: "fish"})];
}
}
// ----
// Warning: (72-162): No visibility specified. Defaulting to "public".
// Warning: (95-108): Unused local variable.
// Warning: (72-162): Function state mutability can be restricted to pure
// Warning: (102-115): Unused local variable.
// Warning: (72-169): Function state mutability can be restricted to pure

View File

@ -2,10 +2,9 @@ pragma experimental ABIEncoderV2;
contract C {
struct S { uint a; T[] sub; }
struct T { uint[] x; }
function f() returns (uint, S) {
function f() public returns (uint, S) {
}
}
// ----
// Warning: (0-33): Experimental features are turned on. Do not use experimental features on live deployments.
// Warning: (112-150): No visibility specified. Defaulting to "public".
// Warning: (112-150): Function state mutability can be restricted to pure
// Warning: (112-157): Function state mutability can be restricted to pure

View File

@ -1,10 +1,8 @@
interface I {
function f();
function f() external;
}
contract C is I {
function f() public {
}
}
// ----
// Warning: (18-31): Functions in interfaces should be declared external.
// Warning: (18-31): No visibility specified. Defaulting to "public". In interfaces it defaults to external.

View File

@ -1,21 +1,18 @@
contract C {
function balance() returns (uint) {
function balance() public returns (uint) {
this.balance; // to avoid pureness warning
return 1;
}
function transfer(uint amount) {
function transfer(uint amount) public {
address(this).transfer(amount); // to avoid pureness warning
}
}
contract D {
function f() {
function f() public {
uint x = (new C()).balance();
x;
(new C()).transfer(5);
}
}
// ----
// Warning: (17-127): No visibility specified. Defaulting to "public".
// Warning: (132-239): No visibility specified. Defaulting to "public".
// Warning: (259-359): No visibility specified. Defaulting to "public".
// Warning: (17-127): Function state mutability can be restricted to view
// Warning: (17-134): Function state mutability can be restricted to view

View File

@ -1,9 +1,7 @@
contract test {
function f() {
function f() public {
function() returns(function() returns(function() returns(function() returns(uint)))) x;
uint y;
y = x()()()();
}
}
// ----
// Warning: (20-175): No visibility specified. Defaulting to "public".

View File

@ -1,9 +1,8 @@
contract A {
function f() {
function f() public {
uint x = 3 < 0 ? 2 > 1 ? 2 : 1 : 7 > 2 ? 7 : 6;
}
}
// ----
// Warning: (17-93): No visibility specified. Defaulting to "public".
// Warning: (40-46): Unused local variable.
// Warning: (17-93): Function state mutability can be restricted to pure
// Warning: (47-53): Unused local variable.
// Warning: (17-100): Function state mutability can be restricted to pure

View File

@ -1,11 +1,10 @@
contract A {
function f() {
function f() public {
uint x = true ? 1 : 0;
uint y = false ? 0 : 1;
}
}
// ----
// Warning: (17-100): No visibility specified. Defaulting to "public".
// Warning: (40-46): Unused local variable.
// Warning: (71-77): Unused local variable.
// Warning: (17-100): Function state mutability can be restricted to pure
// Warning: (47-53): Unused local variable.
// Warning: (78-84): Unused local variable.
// Warning: (17-107): Function state mutability can be restricted to pure

View File

@ -1,11 +1,10 @@
contract A {
function f() {
function f() public {
uint x = 3 > 0 ? 3 : 0;
uint y = (3 > 0) ? 3 : 0;
}
}
// ----
// Warning: (17-103): No visibility specified. Defaulting to "public".
// Warning: (40-46): Unused local variable.
// Warning: (72-78): Unused local variable.
// Warning: (17-103): Function state mutability can be restricted to pure
// Warning: (47-53): Unused local variable.
// Warning: (79-85): Unused local variable.
// Warning: (17-110): Function state mutability can be restricted to pure

View File

@ -1,5 +1,5 @@
contract A {
function f() {
function f() public {
uint x = 3;
uint y = 1;
uint z = (x > y) ? x : y;
@ -7,7 +7,6 @@ contract A {
}
}
// ----
// Warning: (17-143): No visibility specified. Defaulting to "public".
// Warning: (80-86): Unused local variable.
// Warning: (114-120): Unused local variable.
// Warning: (17-143): Function state mutability can be restricted to pure
// Warning: (87-93): Unused local variable.
// Warning: (121-127): Unused local variable.
// Warning: (17-150): Function state mutability can be restricted to pure

View File

@ -1,14 +1,13 @@
contract A {
fixed40x40 storeMe;
function f(ufixed x, fixed32x32 y) {
function f(ufixed x, fixed32x32 y) public {
ufixed8x8 a;
fixed b;
}
}
// ----
// Warning: (41-121): No visibility specified. Defaulting to "public".
// Warning: (52-60): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (62-74): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (86-97): Unused local variable.
// Warning: (107-114): Unused local variable.
// Warning: (41-121): Function state mutability can be restricted to pure
// Warning: (93-104): Unused local variable.
// Warning: (114-121): Unused local variable.
// Warning: (41-128): Function state mutability can be restricted to pure

View File

@ -1,8 +1,7 @@
contract test {
function fun(uint256 a) returns (uint8 b) {
function fun(uint256 a) public returns (uint8 b) {
if (a < 0) b = 0x67; else if (a == 0) b = 0x12; else b = 0x78;
}
}
// ----
// Warning: (20-140): No visibility specified. Defaulting to "public".
// Warning: (20-140): Function state mutability can be restricted to pure
// Warning: (20-147): Function state mutability can be restricted to pure

View File

@ -1,10 +1,9 @@
contract test {
uint256 stateVar;
function functionName(bytes20 arg1, address addr) view returns (int id) { }
function functionName(bytes20 arg1, address addr) public view returns (int id) { }
}
// ----
// Warning: (36-111): No visibility specified. Defaulting to "public".
// Warning: (58-70): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (72-84): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (100-106): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (36-111): Function state mutability can be restricted to pure
// Warning: (107-113): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (36-118): Function state mutability can be restricted to pure

View File

@ -1,9 +1,7 @@
contract c {
enum validEnum { Value1, Value2, Value3, Value4 }
constructor() {
constructor() public {
a = validEnum.Value3;
}
validEnum a;
}
// ----
// Warning: (71-122): No visibility specified. Defaulting to "public".

View File

@ -1,9 +1,8 @@
contract test {
function fun(uint256 a) {
function fun(uint256 a) public {
uint256 x = 3 ** a;
}
}
// ----
// Warning: (20-79): No visibility specified. Defaulting to "public".
// Warning: (54-63): Unused local variable.
// Warning: (20-79): Function state mutability can be restricted to pure
// Warning: (61-70): Unused local variable.
// Warning: (20-86): Function state mutability can be restricted to pure

View File

@ -1,5 +1,5 @@
contract test {
function fun(uint256 a) {
function fun(uint256 a) public {
uint256 i =0;
for (i = 0; i < 10; i++) {
uint256 x = i; break; continue;
@ -7,7 +7,6 @@ contract test {
}
}
// ----
// Warning: (20-162): No visibility specified. Defaulting to "public".
// Warning: (33-42): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (115-124): Unused local variable.
// Warning: (20-162): Function state mutability can be restricted to pure
// Warning: (122-131): Unused local variable.
// Warning: (20-169): Function state mutability can be restricted to pure

View File

@ -1,5 +1,5 @@
contract test {
function fun(uint256 a) {
function fun(uint256 a) public {
uint256 i =0;
for (;;) {
uint256 x = i; break; continue;
@ -7,7 +7,6 @@ contract test {
}
}
// ----
// Warning: (24-170): No visibility specified. Defaulting to "public".
// Warning: (37-46): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (115-124): Unused local variable.
// Warning: (24-170): Function state mutability can be restricted to pure
// Warning: (122-131): Unused local variable.
// Warning: (24-177): Function state mutability can be restricted to pure

View File

@ -1,11 +1,10 @@
contract test {
function fun(uint256 a) {
function fun(uint256 a) public {
uint256 i = 0;
for (i = 0; i < 10; i++)
continue;
}
}
// ----
// Warning: (20-129): No visibility specified. Defaulting to "public".
// Warning: (33-42): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (20-129): Function state mutability can be restricted to pure
// Warning: (20-136): Function state mutability can be restricted to pure

View File

@ -1,12 +1,11 @@
contract test {
function fun(uint256 a) {
function fun(uint256 a) public {
for (uint256 i = 0; i < 10; i++) {
uint256 x = i; break; continue;
}
}
}
// ----
// Warning: (20-148): No visibility specified. Defaulting to "public".
// Warning: (33-42): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (101-110): Unused local variable.
// Warning: (20-148): Function state mutability can be restricted to pure
// Warning: (108-117): Unused local variable.
// Warning: (20-155): Function state mutability can be restricted to pure

View File

@ -1,5 +1,3 @@
contract test {
function functionName(bytes32 input) returns (bytes32 out);
function functionName(bytes32 input) public returns (bytes32 out);
}
// ----
// Warning: (17-76): No visibility specified. Defaulting to "public".

View File

@ -1,10 +1,9 @@
contract test {
uint256 stateVar;
// We won't see this comment
function functionName(bytes32 input) returns (bytes32 out) {}
function functionName(bytes32 input) public returns (bytes32 out) {}
}
// ----
// Warning: (75-136): No visibility specified. Defaulting to "public".
// Warning: (97-110): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (121-132): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (75-136): Function state mutability can be restricted to pure
// Warning: (128-139): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (75-143): Function state mutability can be restricted to pure

View File

@ -1,10 +1,9 @@
contract test {
function f(uint x, uint y) returns (uint a) {}
function f(uint x, uint y) public returns (uint a) {}
function (uint, uint) internal returns (uint) f1 = f;
}
// ----
// Warning: (20-66): No visibility specified. Defaulting to "public".
// Warning: (31-37): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (39-45): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (56-62): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (20-66): Function state mutability can be restricted to pure
// Warning: (63-69): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (20-73): Function state mutability can be restricted to pure

View File

@ -1,15 +1,13 @@
contract test {
function f(uint x, uint y) returns (uint a) {}
function g() {
function f(uint x, uint y) public returns (uint a) {}
function g() public {
function (uint, uint) internal returns (uint) f1 = f;
}
}
// ----
// Warning: (20-66): No visibility specified. Defaulting to "public".
// Warning: (31-37): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (39-45): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (56-62): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (71-153): No visibility specified. Defaulting to "public".
// Warning: (94-142): Unused local variable.
// Warning: (20-66): Function state mutability can be restricted to pure
// Warning: (71-153): Function state mutability can be restricted to pure
// Warning: (63-69): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (108-156): Unused local variable.
// Warning: (20-73): Function state mutability can be restricted to pure
// Warning: (78-167): Function state mutability can be restricted to pure

View File

@ -1,9 +1,8 @@
contract test {
function fun(uint256 a) returns (uint) {
function fun(uint256 a) public returns (uint) {
if (a >= 8) { return 2; } else { uint b = 7; }
}
}
// ----
// Warning: (20-121): No visibility specified. Defaulting to "public".
// Warning: (102-108): Unused local variable.
// Warning: (20-121): Function state mutability can be restricted to pure
// Warning: (109-115): Unused local variable.
// Warning: (20-128): Function state mutability can be restricted to pure

View File

@ -1,9 +1,8 @@
contract c {
uint[] a;
function f() returns (uint, uint) {
function f() public returns (uint, uint) {
a = [1,2,3];
return (a[3], [2,3,4][0]);
}
}
// ----
// Warning: (31-128): No visibility specified. Defaulting to "public".

View File

@ -1,6 +1,5 @@
interface Interface {
function f();
function f() public;
}
// ----
// Warning: (23-36): Functions in interfaces should be declared external.
// Warning: (23-36): No visibility specified. Defaulting to "public". In interfaces it defaults to external.
// Warning: (23-43): Functions in interfaces should be declared external.

View File

@ -1,6 +1,5 @@
library Lib {
function f() { }
function f() public { }
}
// ----
// Warning: (18-34): No visibility specified. Defaulting to "public".
// Warning: (18-34): Function state mutability can be restricted to pure
// Warning: (18-41): Function state mutability can be restricted to pure

View File

@ -1,5 +1,5 @@
contract c {
function f()
function f() public
{
a = 1 wei;
b = 2 szabo;
@ -12,5 +12,4 @@ contract c {
uint256 d;
}
// ----
// Warning: (163-172): This declaration shadows an existing declaration.
// Warning: (17-128): No visibility specified. Defaulting to "public".
// Warning: (170-179): This declaration shadows an existing declaration.

View File

@ -1,9 +1,7 @@
contract c {
constructor()
constructor() public
{
a = 1 wei * 100 wei + 7 szabo - 3;
}
uint256 a;
}
// ----
// Warning: (17-86): No visibility specified. Defaulting to "public".

View File

@ -1,12 +1,11 @@
contract Foo {
function f() {
function f() public {
uint[] storage x;
uint[] memory y;
}
}
// ----
// Warning: (42-58): Uninitialized storage pointer.
// Warning: (19-90): No visibility specified. Defaulting to "public".
// Warning: (42-58): Unused local variable.
// Warning: (68-83): Unused local variable.
// Warning: (19-90): Function state mutability can be restricted to pure
// Warning: (49-65): Uninitialized storage pointer.
// Warning: (49-65): Unused local variable.
// Warning: (75-90): Unused local variable.
// Warning: (19-97): Function state mutability can be restricted to pure

View File

@ -1,8 +1,7 @@
contract c {
modifier mod1(uint a) { if (msg.sender == address(a)) _; }
modifier mod2 { if (msg.sender == address(2)) _; }
function f() mod1(7) mod2 { }
function f() public mod1(7) mod2 { }
}
// ----
// Warning: (135-164): No visibility specified. Defaulting to "public".
// Warning: (135-164): Function state mutability can be restricted to view
// Warning: (135-171): Function state mutability can be restricted to view

View File

@ -1,28 +1,24 @@
contract test {
uint256 stateVar;
/// This is test function 1
function functionName1(bytes32 input) returns (bytes32 out) {}
function functionName1(bytes32 input) public returns (bytes32 out) {}
/// This is test function 2
function functionName2(bytes32 input) returns (bytes32 out) {}
function functionName2(bytes32 input) public returns (bytes32 out) {}
// nothing to see here
function functionName3(bytes32 input) returns (bytes32 out) {}
function functionName3(bytes32 input) public returns (bytes32 out) {}
/// This is test function 4
function functionName4(bytes32 input) returns (bytes32 out) {}
function functionName4(bytes32 input) public returns (bytes32 out) {}
}
// ----
// Warning: (74-136): No visibility specified. Defaulting to "public".
// Warning: (97-110): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (121-132): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (173-235): No visibility specified. Defaulting to "public".
// Warning: (196-209): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (220-231): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (267-329): No visibility specified. Defaulting to "public".
// Warning: (290-303): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (314-325): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (366-428): No visibility specified. Defaulting to "public".
// Warning: (389-402): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (413-424): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (74-136): Function state mutability can be restricted to pure
// Warning: (173-235): Function state mutability can be restricted to pure
// Warning: (267-329): Function state mutability can be restricted to pure
// Warning: (366-428): Function state mutability can be restricted to pure
// Warning: (128-139): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (203-216): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (234-245): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (304-317): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (335-346): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (410-423): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (441-452): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (74-143): Function state mutability can be restricted to pure
// Warning: (180-249): Function state mutability can be restricted to pure
// Warning: (281-350): Function state mutability can be restricted to pure
// Warning: (387-456): Function state mutability can be restricted to pure

View File

@ -1,7 +1,6 @@
contract test {
uint256 stateVar;
function functionName() {}
function functionName() public {}
}
// ----
// Warning: (36-62): No visibility specified. Defaulting to "public".
// Warning: (36-62): Function state mutability can be restricted to pure
// Warning: (36-69): Function state mutability can be restricted to pure

View File

@ -1,9 +1,7 @@
contract test {
function fun(uint a) returns(uint r) { return a; }
function fun(uint a, uint b) returns(uint r) { return a + b; }
function fun(uint a) public returns(uint r) { return a; }
function fun(uint a, uint b) public returns(uint r) { return a + b; }
}
// ----
// Warning: (17-67): No visibility specified. Defaulting to "public".
// Warning: (69-131): No visibility specified. Defaulting to "public".
// Warning: (17-67): Function state mutability can be restricted to pure
// Warning: (69-131): Function state mutability can be restricted to pure
// Warning: (17-74): Function state mutability can be restricted to pure
// Warning: (76-145): Function state mutability can be restricted to pure

View File

@ -1,9 +1,8 @@
contract c {
function fun() returns (uint r) {
function fun() public returns (uint r) {
uint _ = 8;
return _ + 1;
}
}
// ----
// Warning: (17-98): No visibility specified. Defaulting to "public".
// Warning: (17-98): Function state mutability can be restricted to pure
// Warning: (17-105): Function state mutability can be restricted to pure

View File

@ -1,9 +1,8 @@
contract test {
uint256 stateVar;
function functionName(bytes32 input) returns (bytes32 out) {}
function functionName(bytes32 input) public returns (bytes32 out) {}
}
// ----
// Warning: (36-97): No visibility specified. Defaulting to "public".
// Warning: (58-71): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (82-93): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (36-97): Function state mutability can be restricted to pure
// Warning: (89-100): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning: (36-104): Function state mutability can be restricted to pure

View File

@ -1,5 +1,5 @@
contract C {
function f() {
function f() public {
uint a = (1);
(uint b,) = (1,);
(uint c, uint d) = (1, 2 + a);
@ -8,10 +8,9 @@ contract C {
}
}
// ----
// Warning: (47-63): Different number of components on the left hand side (2) than on the right hand side (1).
// Warning: (100-121): Different number of components on the left hand side (2) than on the right hand side (3).
// Warning: (14-136): No visibility specified. Defaulting to "public".
// Warning: (68-74): Unused local variable.
// Warning: (76-82): Unused local variable.
// Warning: (101-107): Unused local variable.
// Warning: (14-136): Function state mutability can be restricted to pure
// Warning: (54-70): Different number of components on the left hand side (2) than on the right hand side (1).
// Warning: (107-128): Different number of components on the left hand side (2) than on the right hand side (3).
// Warning: (75-81): Unused local variable.
// Warning: (83-89): Unused local variable.
// Warning: (108-114): Unused local variable.
// Warning: (14-143): Function state mutability can be restricted to pure

View File

@ -3,15 +3,12 @@ contract c {
uint internal b;
uint public c;
uint d;
function f() {}
function f() public {}
function f_priv() private {}
function f_public() public {}
function f_internal() internal {}
}
// ----
// Warning: (58-71): This declaration shadows an existing declaration.
// Warning: (89-104): No visibility specified. Defaulting to "public".
// Warning: (89-104): Function state mutability can be restricted to pure
// Warning: (109-137): Function state mutability can be restricted to pure
// Warning: (142-171): Function state mutability can be restricted to pure
// Warning: (176-209): Function state mutability can be restricted to pure
// Warning: (89-111): Function state mutability can be restricted to pure
// Warning: (116-144): Function state mutability can be restricted to pure
// Warning: (149-182): Function state mutability can be restricted to pure

View File

@ -0,0 +1,6 @@
pragma experimental "v0.5.0";
contract C {
function f() pure { }
}
// ----
// SyntaxError: (47-68): No visibility specified.

View File

@ -1,6 +1,3 @@
interface I {
function f();
function f() external;
}
// ----
// Warning: (15-28): Functions in interfaces should be declared external.
// Warning: (15-28): No visibility specified. Defaulting to "public". In interfaces it defaults to external.