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

Type aliases do not work with Exceptions. #10889

Closed
kayabaNerve opened this issue Mar 22, 2019 · 1 comment

Comments

Projects
None yet
3 participants
@kayabaNerve
Copy link
Collaborator

commented Mar 22, 2019

When creating a type alias for an Exception, there's a compile time error of raised object of type ref B does not inherit from Exception (on devel).

type
    A = ref object of Exception
    B = A
raise newException(B, "")

The expected behavior is this throws a runtime error with a blank message.

On stable, the error is only a 'ref object' can be raised.

@mratsim mratsim added the Semcheck label Mar 24, 2019

@Araq

This comment has been minimized.

Copy link
Member

commented May 29, 2019

Btw newException works with non-ref object types.

@Araq Araq closed this in 8951680 May 29, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.