Bug when importing an external interface

Started by
5 comments, last by WitchLord 2 years, 5 months ago

Hey,

There seems to be a bug in Angelscript when importing an external interface where that interface extends another interface.

I have confirmed this bug in Angelscript versions 2.34.0 and 2.32.0.

If you Attempt to build the following code:

shared interface ITest {}
shared interface ITest2 : ITest {}
external shared interface ITest2;

Angelscript will end up in an infinite loop.

The method where this happens is void asCBuilder::CompileInterfaces().

I am running this on Windows 10, 64-bit. I am compiling using Visual Studio build tools 2019. I'm compiling for 64-bit.

Please let me know if you need any more information.

Cheers

Jarrett

Advertisement

Thanks for the bug report. I'll look into it and will let you know if I need some more info.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

I've fixed this in rev 2697.

I'm sorry for the long delay.

Regards,
Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This has broken a lot of code for me that did this:

shared interface i {}
shared interface i {}

Obviously that looks a bit silly in that minimal example, but the context is that there are two library files intended for use with #include, each of which has the same identical shared interface declaration. A module might reasonably #include only the first library file, or only the second, or both, but now modules that #include both library files no longer compile.

Thanks for letting me know. I'll take a look at this.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Violet CLM said:
This has broken a lot of code for me that did this: shared interface i {} shared interface i {} Obviously that looks a bit silly in that minimal example, but the context is that there are two library files intended for use with #include, each of which has the same identical shared interface declaration. A module might reasonably #include only the first library file, or only the second, or both, but now modules that #include both library files no longer compile.

Ideally your code shouldn't have duplicate declarations of shared interfaces. To avoid that you can move the declaration of the shared interface to its own file that would be included in both library files, thus when a script includes both library files the file with the declaration of the shared interface would only be included once.

However, I've added an engine property asEP_IGNORE_DUPLICATE_SHARED_INTF in rev 2752 that should allow you to compile your code as before when it is turned on.

Please try the latest WIP version and let me know if you encounter any more issues when upgrading.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement