-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
Here's one way to replicate the polymorphism issue that we were talking about @bakercp.
Create a new project, paste the below classes in and hit run. It gives an error that indicates DerivedClass isn't extending BaseClass (error: cannot convert 'DerivedClass_' to 'BaseClass_' in initialization).
If I open up BaseClass.sketch in sublime, it looks correct. If I open up DerivedClass.sketch in sublime, it hasn't been updated from the default template (so it isn't a subclass of BaseClass).
Haven't gotten a chance to do any additional detective work on this. This is happening on win 8.1 (latest ofSketch), does it happen on OSX?
Main Class:
#include "BaseClass.h"
#include "DerivedClass.h"
void setup() {
std::shared_ptr<BaseClass> a = std::shared_ptr<BaseClass>(new BaseClass());
std::shared_ptr<BaseClass> b = std::shared_ptr<BaseClass>(new DerivedClass());
}Base Class:
#pragma once
class BaseClass{
public:
BaseClass(){
}
};
Derived Class:
#include "BaseClass.h"
class DerivedClass: public BaseClass{
public:
DerivedClass(){
}
};
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels