Thanks, now i understand your engine approach, which doesnt count C# method declaration as a declaration for pascal and causes other processing failures. That is strange to me, but undrestood.
The main problem for me (which im trying to achieve a solution here) are these two errors:
ClassA.pas(19,12): error E633: Cannot invoke type “ClassA”, did you mean to use new?
ClassA.pas(20,5): error E513: Parenthesis are required to call method Apply()
The Purpose of our code is: we are trying to split method implementations we have now all in pascal to two ways
pascal (if need be)
c# (new implementations)
Within same assebly, under one declaration (ideal in C# )
Im trying to get to know, how far can we go on mixing pascal and C# while minimizing pascal. No hard feelings. Now i know, we have to generate pascal declaration for pascal methods and the C# declarations are useless for this case.
Is it going to be a build relese with global using bugfixes today ? Thanks.
I dont need to split the method, that is absurd. I wanted to declare it in C# partial class and implement in Pascal partial class. That is in the testcase.
Well. you say po-tay-toe, I sayb po-taa-toe. That’s what “splitting” it means. C# doe not have a concept of separate method declaration and implementation. you cannot “declare” a method in C# without implementing it. And you can’t implement a method in Oxygene if its not declared in the same file. This is as designed.
I still don’t understand what concrete problem you are trying to solve, though…
—marc
Yes, I’m aware. We had an (unrelated) showstopper that prevented us from shipping a build last Friday. 2841 will be out this coming Friday; i can send you an interim build of you need?
Thanks, just checked and global using itslefs looks good, but the preprocessor ignores directives inside the section with global using, is that intensional ?
Please see, the attached solution and a compile error in project GlobalUsingsTC.elements
Well. “true” isnt defined so technically this is correct. That said, unknown namespaces seem to err in both parts, so that is indeed a big. logging that one.
Hello, ive just found a similar bug as E26599 with global using static syntax in version 10.0.0.2845. Static using is validated even in the conditional inactive code.
There is a project with a testcase: GlobalUsings.zip (1.8 KB)
Just try to build it (in Visual Studio or MSBUILD) , there are two errors, but only one is legit.
Yes, that works frorm ne now in 11.0.0.2851.
Sadly, a have another report:
Global type aliases declared in C# code are not visible from Oxygene code and compiler throws: (E28) Unknown type "GlobalTypeAliasFor" GlobalTypeAliasTC)
The global using declared in C# work also for the Oxygene and thats why i think, the alias should work as well.
We are pushnig it to the limits, we know that.
By the way, one of our developers did some C# syntax test and found some differences to the Rosyln C parser, you might be interested in.
See the example solution here: TestProject.zip (6.1 KB)
There are 5 cases which do not work with Elements, but do work in standard C#.
Sixth case is false-positive identation warning. The file is formatted with Visual Studio 2022 with default formatting.