Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polymorphism Issues: Classes not being saved from browser to .sketch file #142

Open
mikewesthad opened this issue Nov 14, 2014 · 7 comments

Comments

@mikewesthad
Copy link

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(){
    }   
};
@mikewesthad mikewesthad changed the title Polymorphism Issues Polymorphism Issues: Classes not being saved from browser to .sketch file Nov 14, 2014
@mikewesthad
Copy link
Author

Actually, I guess this isn't really a polymorphism issue. It can be summarized simply as:

  1. Create a new project
  2. Create a class
  3. Create a second class

Whatever you put into the second class will not be saved to the .sketch file for the class, and hence, will not be run.

@brannondorsey
Copy link
Member

Yeah, I remember something similar to this happening on Windows at INST-INT. Let me test it on Mac today.

@mikewesthad
Copy link
Author

@brannondorsey, cool. I was running into what I believe to be a similar issue on people's macs in experimental media, but I didn't get anyone to run this code in order to isolate the issue.

@bakercp
Copy link
Member

bakercp commented Sep 30, 2015

This is definitely an issue with RC4. Just came up in class :(

@bakercp
Copy link
Member

bakercp commented Sep 30, 2015

Not sure why the other classes aren't getting saved past initialization.

@bakercp
Copy link
Member

bakercp commented Sep 30, 2015

The work-around is to not make more than 2 tabs. Just past additional subclasses under the 2nd subclass. Ugh, but it works.

@mikewesthad
Copy link
Author

:( I never dug around the source, so I don't have anything more helpful to contribute

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants