Skip to content

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

@Morriar

Description

@Morriar

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
` 
-------------------------------------------------

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions