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

Enum of functions crashing LDC 1.30.0(Windows) #4282

Open
MrcSnm opened this issue Nov 27, 2022 · 2 comments
Open

Enum of functions crashing LDC 1.30.0(Windows) #4282

MrcSnm opened this issue Nov 27, 2022 · 2 comments

Comments

@MrcSnm
Copy link

MrcSnm commented Nov 27, 2022

Tested in LDC 1.30.0 (Windows)
This code:

enum Easing : float function(float x)
{
    identity = (float x) => x
}
void main(){Easing.identity(1);}

Crashes ldc, if I used:

enum Easing : float function(float x)
{
    identity = (x) => x
}
void main(){Easing.identity(1);}

Instead, it won't crash, though it will be templated when there's no reason to.
Seems to be crashing LDC 1.29.0 on run.dlang.io(Linux) too:

#0 0x0000000004add8e3 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/dlang/ldc-1.29.0/bin/ldc2+0x4add8e3)
Error: Error executing /dlang/ldc-1.29.0/bin/ldc2: Trace/breakpoint trap (core dumped)
@MrcSnm MrcSnm changed the title Enum of functions crashing LDC Enum of functions crashing LDC 1.30.0(Windows) Nov 27, 2022
@thewilsonator
Copy link
Contributor

This does not crash DMD.

@MrcSnm
Copy link
Author

MrcSnm commented Nov 27, 2022

Yes, it does not crash DMD.
Although maxter just found a problem in DMD that actually crashes at runtime, I just documented the issue:
https://issues.dlang.org/show_bug.cgi?id=23515

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