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

interpreter: broken constructors when ending with a return #2546

Closed
xymus opened this issue Aug 31, 2017 · 0 comments · Fixed by #2596
Closed

interpreter: broken constructors when ending with a return #2546

xymus opened this issue Aug 31, 2017 · 0 comments · Fixed by #2596
Assignees
Labels

Comments

@xymus
Copy link
Contributor

xymus commented Aug 31, 2017

With the interpreter, constructors ending with a return create objects of the wrong type. I've got a Bool and an ASCIIFlatString depending on the context, adding a print inside the constructor caused it to return an empty ASCIIFlatString.

Minimal example:

class A
	init
	do
		#print "foo" # Would cause the creation of an ASCIIFlatString instead of Bool
		return
	end
end
print((new A).class_name) # Prints `Bool`
@xymus xymus added the bug label Aug 31, 2017
xymus added a commit to xymus/nit that referenced this issue Aug 31, 2017
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
xymus added a commit to xymus/nit that referenced this issue Aug 31, 2017
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
xymus added a commit to xymus/nit that referenced this issue Sep 12, 2017
)

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
xymus added a commit to xymus/nit that referenced this issue Sep 15, 2017
)

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
xymus added a commit to xymus/nit that referenced this issue Sep 18, 2017
)

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
privat added a commit to privat/mynit that referenced this issue Dec 20, 2017
fixes nitlang#2546

Signed-off-by: Jean Privat <jean@pryen.org>
privat added a commit to privat/mynit that referenced this issue Dec 20, 2017
fixes nitlang#2546

Signed-off-by: Jean Privat <jean@pryen.org>
privat added a commit that referenced this issue Jan 11, 2018
fixes #2546

Pull-Request: #2596
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
privat added a commit that referenced this issue Jan 13, 2018
fixes #2546

Pull-Request: #2596
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Delja pushed a commit to Delja/nit that referenced this issue May 17, 2018
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Delja pushed a commit to Delja/nit that referenced this issue May 17, 2018
)

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Delja pushed a commit to Delja/nit that referenced this issue May 17, 2018
fixes nitlang#2546

Signed-off-by: Jean Privat <jean@pryen.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants