Anonymous | Login | 01-15-2021 18:57 UTC |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
0006797 | [Squeak] Compiler | minor | always | 12-03-07 20:47 | 04-18-10 22:05 | ||||
Reporter | nicolas cellier | View Status | public | ||||||
Assigned To | andreas | ||||||||
Priority | normal | Resolution | fixed | ||||||
Status | closed | Product Version | 3.10 | ||||||
Summary | 0006797: Compiler reduce ScaledDecimal with different scales to a single literal | ||||||||
Description |
I encountered this while testing 0004378. Compiler try and reduce number of literals using equality test. Unfortunately, this breaks some ScaledDecimal test: self assert: 0.5s1 scale = 1. self assert: 0.5s2 scale = 2. Each assertion would work individually, but would break together. |
||||||||
Additional Information | |||||||||
Attached Files |
![]() ![]() ![]() ![]() |
||||||||
|
![]() |
|
(0011510 - 116 - 122 - 122 - 122 - 122 - 122) nicolas cellier 12-03-07 21:14 |
Beware, Test.1.cs does define a CompilerTest TestCase. If you have already one in your image, just load the method. |
(0011917 - 183 - 249 - 249 - 249 - 249 - 249) nicolas cellier 03-12-08 22:19 edited on: 04-06-08 16:39 |
"fix begin" Installer mantis bug: 6797 fix:'Compiler-Literal-M6797-nice-Patch.1.cs'. "fix test" Installer mantis bug: 6797 fix:'Compiler-literal-M6797-nice-Test.1.cs'. "fix end" |
(0012535 - 424 - 470 - 470 - 470 - 470 - 470) kwl 08-28-08 12:34 |
in NewCompiler this problem is solved with #literalEqual: oneLiteral literalEqual: otherLiteral and the literal objects decide equality for themselves (take Array for example). the compiler should not know anything about Array, ScaledDecimal and any other literal's equality. the default implementation of #literalEqual: in Object takes class == into account, otherwise 'literal' would be = #literal, for example. |
(0012536 - 660 - 732 - 732 - 732 - 732 - 732) nicolas cellier 08-29-08 07:31 edited on: 08-29-08 07:34 |
Hi Klaus, Thank you for your contribution. I totally agree, my first patch is a quick and dirty lightweight hack, compared to the clean and extensible solution adopted in NewCompiler. You are right to remind us the Smalltalk way. Please find two new versions based on your proposition. NewCompiler-Literal-M6797-nice-Patch.1.cs to patch only the NewCompiler Compiler-Literal-M6797-nice-Patch.2.cs to patch both the (Old)Compiler and NewCompiler. The only problem i foresee doing so, is that loading NewCompiler then unloading it might remove #literalEqual: and thus prevent (Old)Compiler to compile literals. But that's a small packaging problem. |
(0012538 - 153 - 165 - 165 - 165 - 165 - 165) kwl 08-29-08 15:55 |
the new patches look good; I will inform the NewCompiler team (and Pharo team, for that matter) that there is something from you for them. thanks nice |
(0012540 - 181 - 235 - 235 - 235 - 235 - 235) nicolas cellier 08-29-08 19:38 |
"fix begin" Installer mantis bug: 6797 fix:'Compiler-Literal-M6797-nice-Patch.2.cs'. "fix test" Installer mantis bug: 6797 fix:'Compiler-literal-M6797-nice-Test.1.cs'. "fix end" |
(0013300 - 116 - 140 - 442 - 442 - 442 - 442) nicolas cellier 09-12-09 19:25 edited on: 09-12-09 19:37 |
Fixed in: http://source.squeak.org/trunk/Compiler-nice.83.mcz [^] http://source.squeak.org/trunk/Kernel-nice.245.mcz [^] |
Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
93 total queries executed. 46 unique queries executed. |