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

X# compliler flags -xpp1 isn't work #1458

Closed
DenGhostYY opened this issue Apr 25, 2024 · 5 comments
Closed

X# compliler flags -xpp1 isn't work #1458

DenGhostYY opened this issue Apr 25, 2024 · 5 comments
Assignees
Labels
Xbase++ Xbase++ dialect
Projects
Milestone

Comments

@DenGhostYY
Copy link

Describe the bug
Unfortunately the -xpp1 isn't work

Additional context
X# Compiler version 2.19.0.2 (release)
-dialect:xBase++ -lb -enforceself -memvar -xpp1 -vo1 -vo3 -vo4 -vo5 -vo9 -vo10 -vo12 -vo13 -vo14 -vo15 -vo16 -vo17

@RobertvanderHulst
Copy link
Member

Den,
Can you describe the problem in more detail ?

@RobertvanderHulst RobertvanderHulst added the Xbase++ Xbase++ dialect label Apr 25, 2024
@cpyrgas
Copy link

cpyrgas commented Apr 25, 2024

Robert,

See #1243 (comment)
and #1335 (comment)

I have added new tests for the failing cases

@DenGhostYY
Copy link
Author

DenGhostYY commented Apr 26, 2024

Den, Can you describe the problem in more detail ?

Methods ClassName, IsDerivedFrom fail with runtime error.

procedure main()
    local o
    
    o := DerivedExample():new()
    
    ? o:ClassName()
    ? o:IsDerivedFrom("Example")
    return

class DerivedExample from Example
endclass

class Example
endclass
XSharp.Error
  HResult=0x80131500
  Message = No exported method
  Source = XSharp.RT
  Stack trace:
   in XSharp.RT.OOPHelpers.DoSend(Object oObject, String cMethod, __Usual[] args, String cCaller)
   in XSharp.RT.Functions.__InternalSend(__Usual oObject, String cMethod, __Usual[] args)
   in SandBoxXSharp.Exe.Functions.main(__Usual[] Xs$Args) в F:\X#\SandBoxXSharp\SandBoxXSharp\Program.prg:line 8
   in SandBoxXSharp.Exe.Functions.Start(String[] Xs$Args)

RobertvanderHulst referenced this issue Apr 26, 2024
…the ivar does not exist. This triggers the code to access hidden ivars from within a method of the same class.
@RobertvanderHulst
Copy link
Member

The problem in this code is that the preprocessor converts ENDCLASS to END CLASS,
so the code

class Example
endclass

is converted to

class Example
end class

which is matched by the 'normal' class rule, not the xppclass rule.
The normal class rule does not add the Xpp Abstract class as a parent class when /xpp1 is enabled.

I will change the header file, no longer convert that token, and disallow END CLASS as the end of the xppclass rule.

@RobertvanderHulst RobertvanderHulst self-assigned this Apr 29, 2024
@RobertvanderHulst RobertvanderHulst added this to To Do in Build 2.20 via automation Apr 29, 2024
@RobertvanderHulst RobertvanderHulst added this to the 2.20 milestone Apr 29, 2024
@RobertvanderHulst RobertvanderHulst moved this from To Do to Needs Testing in Build 2.20 Apr 29, 2024
@cpyrgas
Copy link

cpyrgas commented May 1, 2024

Confirmed fixed

@cpyrgas cpyrgas closed this as completed May 1, 2024
@cpyrgas cpyrgas moved this from Needs Testing to Done in Build 2.20 May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Xbase++ Xbase++ dialect
Projects
Development

No branches or pull requests

3 participants