Skip to content

Instantly share code, notes, and snippets.

@joseoliv joseoliv/Deprecated.cyan
Last active Jun 12, 2019

Embed
What would you like to do?
deprecated
package metaobjectTest
@doc{*
Annotation 'deprecated' should be attached to a method.
Whenever there is a possible message passing that can call
the method, an error message is issued at compile-time
*}
object Deprecated
@deprecated("Method 'outdatedMethod:' was replaced by 'newMethod:'")
func outdatedMethod: String s { }
func newMethod: String s { "Use this" println }
func run {
// error if uncommented
// self outdatedMethod: "error if uncommented";
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.