1 - Refer again to the line above this in the docs and the types of statements inlined below it. Inlining only affects the immediately following statement. In a forward declaration of a function, there are no calls, assignments, etc. to be inlined.
Declaration in this context refers to variables or constants. For example:
CREATE OR REPLACE PACKAGE BODY foo IS
FUNCTION sub ( p INT ) RETURN INT;
PROCEDURE bar IS
BEGIN
FOR i IN 1 .. 10000000 LOOP
DECLARE
PRAGMA INLINE ( sub, 'YES' );
v INT := sub ( i ) ; -- This is a declaration; SUB is inlined here
BEGIN
NULL;
END;
END LOOP;
END bar;
FUNCTION sub ( p INT ) RETURN INT IS
BEGIN
RETURN p + 1;
END sub;
END foo;
/
/*
LINE/COL ERROR
--------- -------------------------------------------------------------
10/5 PLW-06004: inlining of call of procedure 'SUB' requested
10/5 PLW-06005: inlining of call of procedure 'SUB' was done
17/1 PLW-06027: procedure "SUB" is removed after inlining
*/
2 - It's rare you'll want/need to do this. If you raise the PLSQL_OPTIMIZE_LEVEL to 3, the PL/SQL compiler will attempt to inline everything anyway.
If you'd like the ability to inline all instances of a function, wherever it's called, raise an enhancement request.