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

bug: _intro not initialized when using --keep-going option #2599

Open
Morriar opened this issue Dec 21, 2017 · 0 comments
Open

bug: _intro not initialized when using --keep-going option #2599

Morriar opened this issue Dec 21, 2017 · 0 comments
Labels

Comments

@Morriar
Copy link
Member

Morriar commented Dec 21, 2017

Using the --keep-going option seems to allow partial initialization or MProperties.

Here the code to reproduce the problem:

import nitc::frontend

var toolcontext = new ToolContext
toolcontext.process_options(args)
var arguments = toolcontext.option_context.rest

# build model
var model = new Model
var mbuilder = new ModelBuilder(model, toolcontext)
var mmodules = mbuilder.parse_full(arguments)

# process
if mmodules.is_empty then return
mbuilder.run_phases
toolcontext.run_global_phases(mmodules)

for mproperty in model.mproperties do
	print mproperty.intro
end

When executed on contrib/, this produces:

Runtime error: Uninitialized attribute _intro (/home/morriar/dev/nit/contrib/nitc/model/model.nit:2156)
-------------------------------------------------
--   Stack Trace   ------------------------------
-------------------------------------------------
` fatal_exit
` nitc$MProperty$intro (/home/morriar/dev/nit/contrib/nitc/model/model.nit:2156)
` test::test$core::Sys$main (test.nit:20)
` main
` __libc_start_main
` _start
` 
-------------------------------------------------
@Morriar Morriar added the bug label Dec 21, 2017
privat added a commit to privat/mynit that referenced this issue Dec 21, 2017
so, when keep-going is activated, mproperty.intro and other related services wont crashes.
Thus fixes nitlang#2599
moreover, the mpropdefs attempts are registered in the model (if one need them?).

This might however add some unexpected effects (one does not simply add broken entities into mordor^Wmodel).

TODO: the same thing with classes?
privat added a commit to privat/mynit that referenced this issue Dec 21, 2017
so, when keep-going is activated, mproperty.intro and other related services wont crashes.
Thus fixes nitlang#2599
moreover, the mpropdefs attempts are registered in the model (if one need them?).

This might however add some unexpected effects (one does not simply add broken entities into mordor^Wmodel).

TODO: the same thing with classes?

Signed-off-by: Jean Privat <[email protected]>
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.

1 participant