mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	Adjusts tests to expect type errors on default visibility.
This commit is contained in:
		
							parent
							
								
									b5ecfbe5bc
								
							
						
					
					
						commit
						75bba5c9f0
					
				| @ -670,7 +670,7 @@ BOOST_AUTO_TEST_CASE(nested_loops_multiple_local_vars) | |||||||
| 	// and free local variables properly
 | 	// and free local variables properly
 | ||||||
| 	char const* sourceCode = R"( | 	char const* sourceCode = R"( | ||||||
| 		contract test { | 		contract test { | ||||||
| 			function f(uint x) returns(uint y) { | 			function f(uint x) public returns(uint y) { | ||||||
| 				while (x > 0) { | 				while (x > 0) { | ||||||
| 					uint z = x + 10; | 					uint z = x + 10; | ||||||
| 					uint k = z + 1; | 					uint k = z + 1; | ||||||
| @ -9536,7 +9536,7 @@ BOOST_AUTO_TEST_CASE(continue_in_modifier) | |||||||
| 					_; | 					_; | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 			function f() run { | 			function f() run public { | ||||||
| 				uint k = x; | 				uint k = x; | ||||||
| 				uint t = k + 1; | 				uint t = k + 1; | ||||||
| 				x = t; | 				x = t; | ||||||
| @ -9560,7 +9560,7 @@ BOOST_AUTO_TEST_CASE(return_in_modifier) | |||||||
| 					_; | 					_; | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 			function f() run { | 			function f() run public { | ||||||
| 				uint k = x; | 				uint k = x; | ||||||
| 				uint t = k + 1; | 				uint t = k + 1; | ||||||
| 				x = t; | 				x = t; | ||||||
|  | |||||||
| @ -1,3 +1,3 @@ | |||||||
| contract A { constructor() {} } | contract A { constructor() {} } | ||||||
| // ---- | // ---- | ||||||
| // Warning: (13-29): No visibility specified. Defaulting to "public". | // SyntaxError: (13-29): No visibility specified. | ||||||
|  | |||||||
| @ -3,4 +3,5 @@ contract C { | |||||||
|     function() {} |     function() {} | ||||||
| } | } | ||||||
| // ---- | // ---- | ||||||
|  | // SyntaxError: (90-103): No visibility specified. | ||||||
| // TypeError: (90-103): Fallback function must be defined as "external". | // TypeError: (90-103): Fallback function must be defined as "external". | ||||||
|  | |||||||
| @ -2,4 +2,4 @@ contract C { | |||||||
|     function f() pure { } |     function f() pure { } | ||||||
| } | } | ||||||
| // ---- | // ---- | ||||||
| // Warning: (17-38): No visibility specified. Defaulting to "public". | // SyntaxError: (17-38): No visibility specified. | ||||||
|  | |||||||
| @ -1,6 +0,0 @@ | |||||||
| pragma experimental "v0.5.0"; |  | ||||||
| contract C { |  | ||||||
|     function f() pure { } |  | ||||||
| } |  | ||||||
| // ---- |  | ||||||
| // SyntaxError: (47-68): No visibility specified. |  | ||||||
| @ -2,4 +2,5 @@ interface I { | |||||||
| 	function f(); | 	function f(); | ||||||
| } | } | ||||||
| // ---- | // ---- | ||||||
|  | // SyntaxError: (15-28): No visibility specified. Did you intend to add "public"? | ||||||
| // TypeError: (15-28): Functions in interfaces must be declared external. | // TypeError: (15-28): Functions in interfaces must be declared external. | ||||||
|  | |||||||
| @ -1,7 +0,0 @@ | |||||||
| pragma experimental "v0.5.0"; |  | ||||||
| interface I { |  | ||||||
| 	function f(); |  | ||||||
| } |  | ||||||
| // ---- |  | ||||||
| // SyntaxError: (45-58): No visibility specified. |  | ||||||
| // TypeError: (45-58): Functions in interfaces must be declared external. |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user