diff --git a/src/main/scala/steps/quoted/package.scala b/src/main/scala/steps/quoted/package.scala new file mode 100644 index 0000000..05301dd --- /dev/null +++ b/src/main/scala/steps/quoted/package.scala @@ -0,0 +1,16 @@ +package steps.quoted + +import scala.quoted.* + +extension(using Quotes)(inline cls: quotes.reflect.Symbol) + + /** Check if a given class, trait or object overrides a given definition + * + * @param cls The class, trait or object to inspect + * @param sym The symbol that should be overriden + * @return true if the definition is overriden, false otherwise + */ + inline def overrides(inline sym: quotes.reflect.Symbol): Boolean = + sym.overridingSymbol(cls).exists + +end extension