How to mark a class field as deprecated? #1953
-
| I want to mark a specific class field as deprecated. Currently, this functionality exists for function definitions. I'd want to achieve that same effect for a class field so that when the field is accessed, the diagnostics show the deprecated warning. | 
Beta Was this translation helpful? Give feedback.
      
      
          Answered by
          
            carsakiller
          
      
      
        Feb 27, 2023 
      
    
    Replies: 1 comment 2 replies
-
| It appears that, currently, you can deprecate a literal table field: local literal = {
    keepMe = 0,
    ---@deprecated
    old = 1,
    new = 2
}But not a  | 
Beta Was this translation helpful? Give feedback.
                  
                    2 replies
                  
                
            
      Answer selected by
        C3pa
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
It appears that, currently, you can deprecate a literal table field:
But not a
@fieldannotation