Apex WTF #01

Illia Leshchuk
Mar 25, 2022

What would you expect from the following apex statement System.debug(NonExistingOuterClass.class) — an InvalidType exception, right? And that what you will get. However, what will you get for the System.debug(ExistingOuterClass.NonExistingInnerClass.class)? Frankly speaking I would expect it not to compile, but you’ll get a successful execution with ExistingOuterClass in response. WTF Apex?

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Illia Leshchuk
Illia Leshchuk

Written by Illia Leshchuk

A salesforce developer/architect

No responses yet

Write a response