Nicolas Cellier uploaded a new version of Compiler to project The Trunk: http://source.squeak.org/trunk/Compiler-nice.321.mcz
==================== Summary ====================
Name: Compiler-nice.321 Author: nice Time: 3 May 2016, 9:02:56.110078 am UUID: fd182984-c3ab-4477-bbff-44d9b1744ee3 Ancestors: Compiler-nice.320
Be pedantic: refuse to compile until the user eliminate dead code following a returning if (case when both branches return). Do this only when interactive, we don't like when Compiler refuses to load legacy code.
=============== Diff against Compiler-nice.320 ===============
Item was changed: ----- Method: Parser>>statements:innerBlock:blockNode: (in category 'expression types') ----- statements: argNodes innerBlock: inner blockNode: theBlockNode
| stmts returns start | "give initial comment to block, since others trail statements" theBlockNode comment: currentComment. currentComment := nil. stmts := OrderedCollection new. returns := false. hereType ~~ #rightBracket ifTrue: [[theBlockNode startOfLastStatement: (start := self startOfNextToken). (returns := self matchReturn) ifTrue: [self expression ifFalse: [^self expected: 'Expression to return']. self addComment. stmts addLast: (parseNode isReturningIf ifTrue: [parseNode] ifFalse: [ReturnNode new expr: parseNode encoder: encoder sourceRange: (start to: self endOfLastToken)])] ifFalse: [self expression ifTrue: [self addComment. + "if both branches return, following code is unreachable, let's avoid this. + But only if interactive, we don't want to prevent loading of legacy code" + self interactive ifTrue: [returns := parseNode isReturningIf]. stmts addLast: parseNode] ifFalse: [self addComment. stmts size = 0 ifTrue: [stmts addLast: (encoder encodeVariable: (inner ifTrue: ['nil'] ifFalse: ['self']))]]]. returns ifTrue: [self match: #period. (hereType == #rightBracket or: [hereType == #doIt]) ifFalse: [^self expected: 'End of block']]. returns not and: [self match: #period]] whileTrue]. theBlockNode arguments: argNodes statements: stmts returns: returns from: encoder. parseNode := theBlockNode. ^true!
squeak-dev@lists.squeakfoundation.org