Skip to content

Instantly share code, notes, and snippets.

@joseoliv
Created June 24, 2018 21:36
Show Gist options
  • Save joseoliv/51e4db75232e9bef1357364090a0312c to your computer and use it in GitHub Desktop.
Save joseoliv/51e4db75232e9bef1357364090a0312c to your computer and use it in GitHub Desktop.
checkCatchParameter
package metaobjectTest
@doc{*
checkCatchParameter checks whether each parameter to a catch: selector
has at least one 'eval:' method, each of them accepting one parameter whose
type is subprototype of CyException
*}
object CheckCatchParameter
func run {
// ok, self has an eval: method that accepts a
// parameter that inherits from CyException
self catch: self;
/*
if uncommented, there is a compile-error
because Int does not have an eval: method
*/
// self catch: 0;
}
func eval: ExceptionStr e { }
@checkCatchParameter
func catch: Any e {
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment