You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the following code the implementation of 'MyMethod:String' in class 'Test' does not match the signature of 'MyMethod:Bool" in the interface 'MyInterface':
Interface MyInterface
Method MyMethod:Bool()
EndClassTest Implements MyInterface
MethodMyMethod:String()
Return"string"EndEndFunctionMain()
New Test
End
I get a c++ build error:
Parsing...
Semanting...
Translating...
Compiling...
Build error: System command failed:
g++ -c -std=c++14 -mmacosx-version-min=10.9 -Wno-deprecated-declarations -Wno-tautological-pointer-compare -Wno-undefined-bool-conversion -Wno-int-to-void-pointer-cast -Wno-inconsistent-missing-override -Wno-logical-op-parentheses -Wno-parentheses-equality -O3 -DNDEBUG -I"/Users/danilo/Monkey/monkey2/modules/" -I"/Users/danilo/Monkey/monkey2/modules/monkey/native" -I"/Users/danilo/Monkey/monkey2/tmp/" -DNDEBUG=1 -DBB_THREADS=1 -I"/Users/danilo/Monkey/monkey2/tmp/untitled10.buildv1.1.15/macos_release_mx/build/" -MMD -MF"/Users/danilo/Monkey/monkey2/tmp/untitled10.buildv1.1.15/macos_release_mx/build/r5b58089e.cpp_r.deps" -o "/Users/danilo/Monkey/monkey2/tmp/untitled10.buildv1.1.15/macos_release_mx/build/r5b58089e.cpp_r.o" "/Users/danilo/Monkey/monkey2/tmp/untitled10.buildv1.1.15/macos_release_mx/include/_r.cpp"
In file included from /Users/danilo/Monkey/monkey2/tmp/untitled10.buildv1.1.15/macos_release_mx/include/_r.cpp:9:
/Users/danilo/Monkey/monkey2/tmp/untitled10.buildv1.1.15/macos_release_mx/include/untitled10_untitled10.h:32:12: error: virtual function 'm_MyMethod' has a different return type ('bbString') than the function it overrides (which has return type 'bbBool' (aka 'bool'))
bbString m_MyMethod();
~~~~~~~~ ^
/Users/danilo/Monkey/monkey2/tmp/untitled10.buildv1.1.15/macos_release_mx/include/untitled10_untitled10.h:21:18: note: overridden virtual function is here
virtual bbBool m_MyMethod()=0;
~~~~~~ ^
1 error generated.
***** Fatal mx2cc error *****
Internal mx2cc build error
It always happens when the return type does not match the interface exactly:
Interface MyInterface
Method MyMethod:Int()
EndClassTest Implements MyInterface
MethodMyMethod:UInt()
ReturnTrueEndEndFunctionMain()
New Test
End
The text was updated successfully, but these errors were encountered:
I replaced both types with 'MyMethod:Variant()' compiled fine. I'm assuming C++ doesn't allow this circumstance as I get the same error on Linux as well. Not sure if this is a proper solution.
In the following code the implementation of 'MyMethod:String' in class 'Test' does not match the signature of 'MyMethod:Bool" in the interface 'MyInterface':
I get a c++ build error:
It always happens when the return type does not match the interface exactly:
The text was updated successfully, but these errors were encountered: