Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Reproduction components for a Spring '18 issue with virtual classes and lightning
public class MyOverrideClass extends MyVirtualClass {
public override String getName() {
return 'MyOverrideClass';
public override Object getObj() {
return 'Hello World';
public virtual class MyVirtualClass {
public virtual String getName() {
return 'MyVirtualClass';
public virtual Object getObj() {
return 99;
public Integer getVirtualOnlyValue() {
return 1;
<aura:component controller="VirtualClassTestController" implements="forceCommunity:availableForAllPageTypes" access="global" >
<aura:attribute name="dataString" type="String" access="PRIVATE" />
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<lightning:card title="Spring '18 Issue Reproduction">
<p class="slds-m-vertical_small">We should be seeing a <code>name</code> value of "MyOverrideClass" and an obj of type String with a value of '11'</p>
<h2 class="slds-text-heading_small">Data</h2>
public class VirtualClassTestController {
public static MyOverrideClass getClass() {
return new MyOverrideClass();
doInit : function(component, event, helper) {
var action = component.get('c.getClass');
action.setCallback(this, function(response){
var data = response.getReturnValue();
component.set('v.dataString', JSON.stringify(data));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment