Type checker doesn't assign types to subexprs on exprs with types

Bug #578082 reported by Matt Giuca
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mars
Fix Released
High
Matt Giuca

Bug Description

Typically, expressions come to the type checker without types (as the parser is too lazy/stupid to assign them). However, the parser does assign some expressions types (notably, string literals, as a fix for bug #483369). If the type checker receives an expr with a type, it will a) believe it (which may be foolish), and b) not recurse and assume the subexpressions also have types. This is not always the case, as string literals, for example, do not assign a type to their subexpressions.

Rather than fixing the parser to assign types to subexpressions, instead have the type checker check the type of the expression regardless, and recurse, and also unify it with the already-assigned type (this will identify any mistakes in the existing type allocations, and be more robust).

Blocking bug #574108.

Tags: types

Related branches

Revision history for this message
Matt Giuca (mgiuca) wrote :

Fixed in trunk r1028.

Changed in mars:
status: Triaged → Fix Committed
Matt Giuca (mgiuca)
Changed in mars:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.