mirror of
				https://github.com/astral-sh/ruff.git
				synced 2025-11-03 21:24:29 +00:00 
			
		
		
		
	[ty] Fix tiny mistake in protocol tests (#20743)
This commit is contained in:
		
							parent
							
								
									f90d6466e0
								
							
						
					
					
						commit
						23ebfe7777
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -964,11 +964,14 @@ class Foo(Protocol):
 | 
			
		|||
 | 
			
		||||
    def __init__(self) -> None:
 | 
			
		||||
        self.x = 42  # fine
 | 
			
		||||
 | 
			
		||||
        self.a = 56  # TODO: should emit diagnostic
 | 
			
		||||
        self.b: int = 128  # TODO: should emit diagnostic
 | 
			
		||||
 | 
			
		||||
    def non_init_method(self) -> None:
 | 
			
		||||
        self.y = 64  # fine
 | 
			
		||||
        self.x = 64  # fine
 | 
			
		||||
        self.y = "bar"  # fine
 | 
			
		||||
 | 
			
		||||
        self.c = 72  # TODO: should emit diagnostic
 | 
			
		||||
 | 
			
		||||
# Note: the list of members does not include `a`, `b` or `c`,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue