mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Remove PropertyBinding rule, just use Binding
This commit is contained in:
parent
abc4e5de65
commit
0a4b5d07a1
16 changed files with 100 additions and 179 deletions
|
@ -291,7 +291,7 @@ class IdentLiteral(AstNode):
|
|||
actions=[CodeAction("Use 'template'", "template")],
|
||||
)
|
||||
|
||||
elif expected_type is not None:
|
||||
elif expected_type is not None or self.context[ValueTypeCtx].must_infer_type:
|
||||
object = self.context[ScopeCtx].objects.get(self.ident)
|
||||
if object is None:
|
||||
if self.ident == "null":
|
||||
|
@ -305,7 +305,11 @@ class IdentLiteral(AstNode):
|
|||
self.context[ScopeCtx].objects.keys(),
|
||||
),
|
||||
)
|
||||
elif object.gir_class and not object.gir_class.assignable_to(expected_type):
|
||||
elif (
|
||||
expected_type is not None
|
||||
and object.gir_class is not None
|
||||
and not object.gir_class.assignable_to(expected_type)
|
||||
):
|
||||
raise CompileError(
|
||||
f"Cannot assign {object.gir_class.full_name} to {expected_type.full_name}"
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue