Alamvic / druid

Meta-compiler to generate an optimised JIT compiler frontend based on an Interpreter definition
8 stars 6 forks source link

Review the relation between type and typeWithAlreadySeen #111

Open guillep opened 6 months ago

guillep commented 6 months ago

In

typeWithAlreadySeen: aCollection

    (aCollection includes: self)
        ifTrue: [ ^ DRUndefinedType new ].

    aCollection add: self.
    self operands do: [ :e | | operandType |
        operandType := e typeWithAlreadySeen: aCollection.
        "If nil it means it's a recursive type, we continue with the next operand"
        operandType isUndefined ifFalse: [ ^ operandType ] ].

    self error: 'Cannot compute instruction type'

we do not take into account redefinitions of type