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

Cannot use function in Super.New() method #39

Closed
wiebow opened this issue Jul 26, 2016 · 8 comments
Closed

Cannot use function in Super.New() method #39

wiebow opened this issue Jul 26, 2016 · 8 comments

Comments

@wiebow
Copy link

wiebow commented Jul 26, 2016

I am trying to call a function when creating an extended class, and calling the Super.New() method. This result in a Memory Access Violation, while the base class does have the New() method that accept an image:

Method New()
    Super.New( GetImage("sprites",1) )
End Method

GetImage(name, frame) is a function that will return an image from an array.

While this works, where images is a global variable, set to an image:

Method New()
    Super.New(images)
End Method
@wiebow
Copy link
Author

wiebow commented Sep 9, 2016

Is this intended behaviour @blitz-research ?

@blitz-research
Copy link
Owner

No, MAV's aren't intended behaviour!

Should be fixed now.

@wiebow
Copy link
Author

wiebow commented Sep 11, 2016

@blitz-research , I assume the fix has not been uploaded yet, as the problem is still there.

@blitz-research
Copy link
Owner

Have you done an updatemx2cc?

On Sun, Sep 11, 2016 at 7:49 PM, Wiebo de Wit notifications@github.com
wrote:

I assume the fix has not been uploaded yet, as the problem is still there.


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
#39 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADU3QhwAhfk0z9gW_sVNJtQRmWjJv5F3ks5qo7J3gaJpZM4JVRbK
.

@blitz-research
Copy link
Owner

...and if it's still happening can you post some runnable code? I threw
something together for testing that works, but it may not be the same...

On Sun, Sep 11, 2016 at 8:31 PM, Mark Sibly blitzmunter@gmail.com wrote:

Have you done an updatemx2cc?

On Sun, Sep 11, 2016 at 7:49 PM, Wiebo de Wit notifications@github.com
wrote:

I assume the fix has not been uploaded yet, as the problem is still there.


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
#39 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADU3QhwAhfk0z9gW_sVNJtQRmWjJv5F3ks5qo7J3gaJpZM4JVRbK
.

@blitz-research
Copy link
Owner

Here's the sample I used, which used to crash like crazy...

Class T
Field str:String
Method New( str:String )
Self.str=str
Print "T.New("+str+")"
End
End

Function F:T( str:String )
Return New T( str )
End

Class C

Method New( t:T )
Print "Here! t.str="+t.str
End
End
Class D Extends C

Method New( str:String )
Super.New( F( str ) )
End
End

Function Main()

New D( "Hello!" )
End

On Sun, Sep 11, 2016 at 8:32 PM, Mark Sibly blitzmunter@gmail.com wrote:

...and if it's still happening can you post some runnable code? I threw
something together for testing that works, but it may not be the same...

On Sun, Sep 11, 2016 at 8:31 PM, Mark Sibly blitzmunter@gmail.com wrote:

Have you done an updatemx2cc?

On Sun, Sep 11, 2016 at 7:49 PM, Wiebo de Wit notifications@github.com
wrote:

I assume the fix has not been uploaded yet, as the problem is still
there.


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
#39 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADU3QhwAhfk0z9gW_sVNJtQRmWjJv5F3ks5qo7J3gaJpZM4JVRbK
.

@wiebow
Copy link
Author

wiebow commented Sep 11, 2016

Apparently updateall.sh does not update mx2cc? I performed the update as you suggested and now it's compiling and running!!! Thanks.

This allows me to get of a lot of workaround code in object creation etc...

@blitz-research
Copy link
Owner

Yay!

Yeah, only 'tagged' releases have prebuilt binaries in them.

It's tricky to add updatemx2cc to rebuildall, as depending on what I've
been playing with you either need to build modules first or mx2cc.

Should add this to the readme...

On Sun, Sep 11, 2016 at 8:41 PM, Wiebo de Wit notifications@github.com
wrote:

Apparently updateall.sh does not update mx2cc? I performed the update as
you suggested and now it's compiling and running!!! Thanks.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#39 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADU3Qjmfupw_IA5Wf1AZaROMCGmmdAwjks5qo761gaJpZM4JVRbK
.

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

2 participants