-
Notifications
You must be signed in to change notification settings - Fork 112
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
stack-overflow bug: A nested record can't be it's interface parent #860
Comments
This is somewhat related to #870. We might want to just forbid nesting records in interfaces since interfaces don't generate code. |
The bug also happened with nested interfaces. I made a small tweak so that it doesn't crash anymore, but I'm wondering if other weird behaviors might come up from it. Is there a real-life use-case for an inner interface that extends its outer interface? I'm afraid such circular types will start causing other problems... |
Maybe due to exporting to other modules? interA.tl: local interface A
a: integer
interface B is A
b: string
end
end
return A test.tl: local type A = require 'interA'
local x: A.B = {
a = 10,
b = 'hello'
}
print(x.a, x.b) --> 10 hello |
@Andre-LA this still looks like a "synthetic" example, I'm afraid... |
FWIW, you can nest interfaces like this is Java. It’s solely used for grouping. |
Nesting interfaces is supported. Having the nested one its own parent (producing a circular nesting once the inner interface is resolved) is the thing I'm finding odd here. |
The code below crashes the compiler on a stack overflow on the
close_nested_records
function:Teal version: 0.24.1
The text was updated successfully, but these errors were encountered: