mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #7278 from ethereum/develop
Merge develop into develop_060
This commit is contained in:
@@ -4,3 +4,5 @@ contract C {
|
||||
fixed a3 = 0 / 0.123;
|
||||
fixed a4 = 0 / -0.123;
|
||||
}
|
||||
// ----
|
||||
// UnimplementedFeatureError: Not yet implemented - FixedPointType.
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
==== Source: a ====
|
||||
import "b"; contract C { D d; }
|
||||
==== Source: b ====
|
||||
import "a"; contract D { C c; }
|
||||
@@ -0,0 +1,5 @@
|
||||
==== Source: a ====
|
||||
contract A {} contract B {} contract C { struct S { uint a; } }
|
||||
==== Source: b ====
|
||||
import "a" as x; import {B as b, C as c, C} from "a";
|
||||
contract D is b { function f(c.S memory var1, x.C.S memory var2, C.S memory var3) internal {} }
|
||||
@@ -0,0 +1,6 @@
|
||||
==== Source: a/.b.sol ====
|
||||
contract B {}
|
||||
==== Source: a/a.sol ====
|
||||
import ".b.sol"; contract A is B {}
|
||||
// ----
|
||||
// ParserError: (a/a.sol:0-16): Source ".b.sol" not found: File not supplied initially.
|
||||
@@ -0,0 +1,6 @@
|
||||
==== Source: a ====
|
||||
contract C { D d; }
|
||||
==== Source: b ====
|
||||
import "a"; contract D is C {}
|
||||
// ----
|
||||
// DeclarationError: (a:13-14): Identifier not found or not unique.
|
||||
@@ -0,0 +1,7 @@
|
||||
==== Source: a ====
|
||||
contract C { }
|
||||
==== Source: b ====
|
||||
import "a";
|
||||
==== Source: c ====
|
||||
import "b";
|
||||
contract D is C {}
|
||||
@@ -0,0 +1,23 @@
|
||||
==== Source: A.sol ====
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
contract A
|
||||
{
|
||||
struct S { uint a; }
|
||||
S public s;
|
||||
function f(S memory _s) public returns (S memory,S memory) { }
|
||||
}
|
||||
==== Source: B.sol ====
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
import "./A.sol";
|
||||
contract B is A { }
|
||||
==== Source: C.sol ====
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
import "./B.sol";
|
||||
contract C is B { }
|
||||
// ----
|
||||
// Warning: (A.sol:0-33): Experimental features are turned on. Do not use experimental features on live deployments.
|
||||
// Warning: (B.sol:0-33): Experimental features are turned on. Do not use experimental features on live deployments.
|
||||
// Warning: (C.sol:0-33): Experimental features are turned on. Do not use experimental features on live deployments.
|
||||
@@ -0,0 +1,21 @@
|
||||
==== Source: A.sol ====
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
contract A
|
||||
{
|
||||
struct S { uint a; }
|
||||
S public s;
|
||||
function f(S memory _s) public returns (S memory,S memory) { }
|
||||
}
|
||||
==== Source: B.sol ====
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
import "./A.sol";
|
||||
contract B is A { }
|
||||
==== Source: C.sol ====
|
||||
import "./B.sol";
|
||||
contract C is B { }
|
||||
// ----
|
||||
// Warning: (A.sol:0-33): Experimental features are turned on. Do not use experimental features on live deployments.
|
||||
// Warning: (B.sol:0-33): Experimental features are turned on. Do not use experimental features on live deployments.
|
||||
// TypeError: (C.sol:18-37): Contract "C" does not use the new experimental ABI encoder but wants to inherit from a contract which uses types that require it. Use "pragma experimental ABIEncoderV2;" for the inheriting contract as well to enable the feature.
|
||||
@@ -0,0 +1,18 @@
|
||||
==== Source: A.sol ====
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
contract A
|
||||
{
|
||||
struct S { uint a; }
|
||||
S public s;
|
||||
function f(S memory _s) public returns (S memory,S memory) { }
|
||||
}
|
||||
==== Source: B.sol ====
|
||||
import "./A.sol";
|
||||
contract B is A { }
|
||||
==== Source: C.sol ====
|
||||
import "./B.sol";
|
||||
contract C is B { }
|
||||
// ----
|
||||
// Warning: (A.sol:0-33): Experimental features are turned on. Do not use experimental features on live deployments.
|
||||
// TypeError: (B.sol:18-37): Contract "B" does not use the new experimental ABI encoder but wants to inherit from a contract which uses types that require it. Use "pragma experimental ABIEncoderV2;" for the inheriting contract as well to enable the feature.
|
||||
@@ -0,0 +1,8 @@
|
||||
==== Source: a ====
|
||||
library A {}
|
||||
==== Source: b ====
|
||||
library A {}
|
||||
==== Source: c ====
|
||||
import {A} from "./a"; import {A} from "./b";
|
||||
// ----
|
||||
// DeclarationError: (c:23-45): Identifier already declared.
|
||||
@@ -0,0 +1,4 @@
|
||||
==== Source: a ====
|
||||
contract A {}
|
||||
==== Source: b ====
|
||||
library A {}
|
||||
@@ -0,0 +1,6 @@
|
||||
==== Source: a ====
|
||||
contract A {}
|
||||
==== Source: b ====
|
||||
import "a"; contract A {}
|
||||
// ----
|
||||
// DeclarationError: (b:12-25): Identifier already declared.
|
||||
@@ -0,0 +1,6 @@
|
||||
==== Source: a ====
|
||||
contract A {}
|
||||
==== Source: b ====
|
||||
import "a" as A; contract A {}
|
||||
// ----
|
||||
// DeclarationError: (b:17-30): Identifier already declared.
|
||||
@@ -0,0 +1,6 @@
|
||||
==== Source: a ====
|
||||
contract A {}
|
||||
==== Source: b ====
|
||||
import {A as b} from "a"; contract b {}
|
||||
// ----
|
||||
// DeclarationError: (b:26-39): Identifier already declared.
|
||||
@@ -0,0 +1,6 @@
|
||||
==== Source: a ====
|
||||
contract A {}
|
||||
==== Source: b ====
|
||||
import {A} from "a"; contract A {}
|
||||
// ----
|
||||
// DeclarationError: (b:21-34): Identifier already declared.
|
||||
@@ -0,0 +1,4 @@
|
||||
==== Source: a ====
|
||||
contract A {}
|
||||
==== Source: b ====
|
||||
import {A} from "a"; contract B {}
|
||||
@@ -0,0 +1,4 @@
|
||||
==== Source: a ====
|
||||
contract C {}
|
||||
==== Source: b ====
|
||||
import "a"; contract D is C {}
|
||||
@@ -0,0 +1,6 @@
|
||||
==== Source: a ====
|
||||
import "./dir/b"; contract A is B {}
|
||||
==== Source: dir/b ====
|
||||
contract B {}
|
||||
==== Source: dir/c ====
|
||||
import "../a"; contract C is A {}
|
||||
@@ -0,0 +1,4 @@
|
||||
==== Source: a ====
|
||||
contract A {}
|
||||
==== Source: dir/a/b/c ====
|
||||
import "../../.././a"; contract B is A {}
|
||||
@@ -0,0 +1,6 @@
|
||||
==== Source: B.sol ====
|
||||
contract C {}
|
||||
==== Source: b ====
|
||||
import {C as msg} from "B.sol";
|
||||
// ----
|
||||
// Warning: (B.sol:0-13): This declaration shadows a builtin symbol.
|
||||
@@ -0,0 +1,8 @@
|
||||
==== Source: B.sol ====
|
||||
contract X {}
|
||||
==== Source: b ====
|
||||
import * as msg from "B.sol";
|
||||
contract C {
|
||||
}
|
||||
// ----
|
||||
// Warning: (b:0-29): This declaration shadows a builtin symbol.
|
||||
@@ -0,0 +1,11 @@
|
||||
==== Source: B.sol ====
|
||||
contract msg {} contract block{}
|
||||
==== Source: b ====
|
||||
import {msg, block} from "B.sol";
|
||||
contract C {
|
||||
}
|
||||
// ----
|
||||
// Warning: (B.sol:0-15): This declaration shadows a builtin symbol.
|
||||
// Warning: (B.sol:16-32): This declaration shadows a builtin symbol.
|
||||
// Warning: (B.sol:0-15): This declaration shadows a builtin symbol.
|
||||
// Warning: (B.sol:16-32): This declaration shadows a builtin symbol.
|
||||
@@ -0,0 +1,8 @@
|
||||
==== Source: a ====
|
||||
library A {}
|
||||
==== Source: b ====
|
||||
library A {}
|
||||
==== Source: c ====
|
||||
import {A} from "./a"; import {A} from "./b";
|
||||
// ----
|
||||
// DeclarationError: (c:23-45): Identifier already declared.
|
||||
@@ -0,0 +1,4 @@
|
||||
==== Source: a ====
|
||||
contract A {}
|
||||
==== Source: dir/a/b/c ====
|
||||
import "../../.././a" as x; contract B is x.A { function() external { x.A r = x.A(20); r; } }
|
||||
@@ -0,0 +1,2 @@
|
||||
==== Source: a ====
|
||||
contract C {}
|
||||
@@ -4,5 +4,6 @@ contract test {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// UnimplementedFeatureError: Not yet implemented - FixedPointType.
|
||||
// Warning: (50-67): Unused local variable.
|
||||
// Warning: (20-119): Function state mutability can be restricted to pure
|
||||
|
||||
@@ -4,5 +4,6 @@ contract test {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// UnimplementedFeatureError: Not yet implemented - FixedPointType.
|
||||
// Warning: (50-73): Unused local variable.
|
||||
// Warning: (20-118): Function state mutability can be restricted to pure
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
==== Source: A ====
|
||||
contract A {
|
||||
function g() public { x; }
|
||||
}
|
||||
==== Source: B ====
|
||||
contract B {
|
||||
function f() public { }
|
||||
}
|
||||
// ----
|
||||
// DeclarationError: (A:36-37): Undeclared identifier.
|
||||
@@ -0,0 +1,12 @@
|
||||
==== Source: A ====
|
||||
contract A {
|
||||
function g(uint256 x) public view returns(uint256) { return x; }
|
||||
}
|
||||
==== Source: B ====
|
||||
import "A";
|
||||
contract B is A {
|
||||
function f(uint256 x) public view returns(uint256) { return x; }
|
||||
}
|
||||
// ----
|
||||
// Warning: (A:14-78): Function state mutability can be restricted to pure
|
||||
// Warning: (B:31-95): Function state mutability can be restricted to pure
|
||||
@@ -0,0 +1,5 @@
|
||||
==== Source: a ====
|
||||
import "b";
|
||||
contract C {}
|
||||
// ----
|
||||
// ParserError: (a:0-11): Source "b" not found: File not supplied initially.
|
||||
@@ -0,0 +1,10 @@
|
||||
==== Source: A ====
|
||||
contract A {
|
||||
function g(uint256 x) public view returns(uint256) { return x; }
|
||||
}
|
||||
==== Source: B ====
|
||||
contract B is A {
|
||||
function f(uint256 x) public view returns(uint256) { return x; }
|
||||
}
|
||||
// ----
|
||||
// DeclarationError: (B:14-15): Identifier not found or not unique.
|
||||
@@ -0,0 +1,7 @@
|
||||
==== Source: SourceName ====
|
||||
contract A {
|
||||
uint256 x;
|
||||
function f() public pure { x = 42; }
|
||||
}
|
||||
// ----
|
||||
// TypeError: (SourceName:53-54): Function declared as pure, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.
|
||||
@@ -0,0 +1,11 @@
|
||||
==== Source: A ====
|
||||
contract A {
|
||||
function g(uint256 x) public view returns(uint256) { return x; }
|
||||
}
|
||||
==== Source: B ====
|
||||
contract B {
|
||||
function f(uint256 x) public view returns(uint256) { return x; }
|
||||
}
|
||||
// ----
|
||||
// Warning: (A:14-78): Function state mutability can be restricted to pure
|
||||
// Warning: (B:14-78): Function state mutability can be restricted to pure
|
||||
@@ -8,4 +8,5 @@ contract test {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// UnimplementedFeatureError: Not yet implemented - FixedPointType.
|
||||
// Warning: (20-147): Function state mutability can be restricted to pure
|
||||
|
||||
+1
@@ -6,4 +6,5 @@ contract test {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// UnimplementedFeatureError: Not yet implemented - FixedPointType.
|
||||
// Warning: (20-104): Function state mutability can be restricted to pure
|
||||
|
||||
+1
@@ -6,4 +6,5 @@ contract test {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// UnimplementedFeatureError: Not yet implemented - FixedPointType.
|
||||
// Warning: (20-108): Function state mutability can be restricted to pure
|
||||
|
||||
+2
@@ -5,3 +5,5 @@ contract test {
|
||||
a; b;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// UnimplementedFeatureError: Not yet implemented - FixedPointType.
|
||||
|
||||
+2
@@ -7,3 +7,5 @@ contract A {
|
||||
a; b; c; d;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// UnimplementedFeatureError: Not yet implemented - FixedPointType.
|
||||
|
||||
@@ -5,4 +5,5 @@ contract test {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// UnimplementedFeatureError: Not yet implemented - FixedPointType.
|
||||
// Warning: (20-104): Function state mutability can be restricted to pure
|
||||
|
||||
+1
@@ -6,4 +6,5 @@ contract test {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// UnimplementedFeatureError: Not yet implemented - FixedPointType.
|
||||
// Warning: (20-182): Function state mutability can be restricted to pure
|
||||
|
||||
@@ -4,3 +4,5 @@ contract test {
|
||||
fixedString[0.5] = "Half";
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// UnimplementedFeatureError: Not yet implemented - FixedPointType.
|
||||
|
||||
@@ -5,3 +5,5 @@ contract test {
|
||||
}
|
||||
myStruct a = myStruct(3.125, 3);
|
||||
}
|
||||
// ----
|
||||
// UnimplementedFeatureError: Not yet implemented - FixedPointType.
|
||||
|
||||
+1
@@ -11,5 +11,6 @@ contract test {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// UnimplementedFeatureError: Not yet implemented - FixedPointType.
|
||||
// Warning: (238-252): This declaration shadows an existing declaration.
|
||||
// Warning: (20-339): Function state mutability can be restricted to pure
|
||||
|
||||
+1
@@ -4,5 +4,6 @@ contract test {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// UnimplementedFeatureError: Not yet implemented - FixedPointType.
|
||||
// Warning: (50-58): Unused local variable.
|
||||
// Warning: (20-89): Function state mutability can be restricted to pure
|
||||
|
||||
@@ -6,6 +6,7 @@ contract A {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// UnimplementedFeatureError: Not yet implemented - FixedPointType.
|
||||
// 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: (93-104): Unused local variable.
|
||||
|
||||
@@ -7,3 +7,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// UnimplementedFeatureError: Not yet implemented - FixedPointType.
|
||||
|
||||
@@ -6,3 +6,5 @@ contract test {
|
||||
a; b; c;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// UnimplementedFeatureError: Not yet implemented - FixedPointType.
|
||||
|
||||
@@ -13,3 +13,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// UnimplementedFeatureError: Not yet implemented - FixedPointType.
|
||||
|
||||
Reference in New Issue
Block a user