Vinod John
Vinod John

Reputation: 3

Xtext: cannot be resolved to a type

I have strange error in my code:

import dsltest.models.Plant    
import dsltest.controllers.PlantController.create

package dsltest.assemblers {

assembler PlantAssembler : Plant {

    state CREATES
        create => PENDING
    end

    state PENDING

    end
}
}

Error: "dsltest.controllers.PlantController.create cannot be resolved to a type." occurs at import(second line). There is no error at first line import.

"create" is a method encapsulated by controller-"PlantController"

I tried to clean project, but it didn't help. Please someone help me to solve this.

Upvotes: 0

Views: 889

Answers (1)

Anton Kosyakov
Anton Kosyakov

Reputation: 365

You should use a static import declaration to import static members:

import static dsltest.controllers.PlantController.create

Otherwise dsltest.controllers.PlantController.create is treated as a reference to JvmDeclaredType.

Upvotes: 2

Related Questions