question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Refactor Bug List

See original GitHub issue

I’m going to keep this updated with any issues (as replies) I find relating to the new compiler while I move my game across.


Static Field Emit

    function ZStats.new(...)
        local self = setmetatable({}, ZStats)
        self:constructor(...)
        return self
    end
    ZStats.ZERO = ZStats.new({}, 0)
    ZStats.BASE = ZStats.new({}, 1)
    function ZStats:constructor(stats, defaultStatAmount)
        if defaultStatAmount == nil then defaultStatAmount = 0 end
        self.mStrength = ((stats.Strength ~= nil) and stats.Strength or defaultStatAmount);
        self.mEndurance = ((stats.Endurance ~= nil) and stats.Endurance or defaultStatAmount);
        self.mIntellect = ((stats.Intellect ~= nil) and stats.Intellect or defaultStatAmount);
        self.mSpirit = ((stats.Spirit ~= nil) and stats.Spirit or defaultStatAmount);
        self.mAgility = ((stats.Agility ~= nil) and stats.Agility or defaultStatAmount);
        self.mCriticalStrike = ((stats.CriticalStrike ~= nil) and stats.CriticalStrike or defaultStatAmount)
    end

Static fields should be after constructor, as in this instance - constructor isn’t defined and Lua throws an error due to this.


This can be worked around by moving the static fields below the constructor, but it should always have the constructor first regardless.


Bug List

Functions

Classes

  • Static Field Emit

Objects

Indexing

Macros

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
brianush1commented, Jul 5, 2020

Use of string.includes emits invalid code

https://osyrisrblx.github.io/playground/#code/A4JwlgdgLgFARAQwM4BM4DpIGMA2BXFAUyXiTgEpyBuAKCA

print("asd".includes("s"));

The code generated for this segment is erroneous:

-- Compiled with roblox-ts v0.4.0
print(("asd"):includes("s"))
return nil

1reaction
Vorliascommented, Jun 26, 2020

Return value of push is incorrect

https://osyrisrblx.github.io/playground/#code/MYewdgzgLgBFCm0CCAnFBDAnjAvDA2gEQAS8ANmSIQLoDcAUPaJLAJYAmAHrnIlKhkwA6AA4BXCAAsAFIUms4k+CniEAlAxEpWYKNI6cNQA

const testArray = ["Hello"];

const idx = testArray.push("hi there");
print(idx);

The expected output should be 2, as it’s the second element. 3 is given instead.

Incorrect emit:

-- Compiled with roblox-ts v0.4.0
local testArray = { "Hello" }
-- ▼ Array.push ▼
testArray[#testArray + 1] = "hi there"
-- ▲ Array.push ▲
local idx = #testArray + 1
print(idx)

Corrected emit:

-- Compiled with roblox-ts v0.4.0
local testArray = { "Hello" }
-- ▼ Array.push ▼
testArray[#testArray + 1] = "hi there"
-- ▲ Array.push ▲
local idx = #testArray
print(idx)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug List
ID Product Comp Assignee△ Status△ Changed 141777 java Refactor ralphbenjamin NEW 2016‑03‑25 271688 java Refactor sdedic NEW 2018‑04‑02 155315 java Refactor jbecicka NEW 2010‑09‑23
Read more >
Bug List - Bugs - Eclipse
ID Product Comp Assignee△ Status△ Changed 240394 Java Ser Core cameron.bateman NEW 2013‑02‑07 265540 z_Archiv Eclipsel nobody NEW 2022‑06‑09 202262 CDT cdt‑core cdt‑core‑inbox NEW 2020‑09‑04
Read more >
Statistical Analysis of Eclipse Refactoring Bug Reports
Statistical Analysis of Eclipse Refactoring Bug Reports ... Fowler's web site lists over 90 refactorings ... Eclipse Bug Report System.
Read more >
On the Relationship between Refactoring Actions and Bugs
Then, by mining the change history of the three systems, the authors identified bug- fixing commits by linking commit messages and issue tracker...
Read more >
Statistical Analysis of Refactoring Bug Reports in Eclipse ...
We discovered that 5,045 bugs related to JDT refactorings have been reported on Eclipse's bug report website (Eclipse Bugzilla) as of January 2021....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found