johnfn / ts2gd

💥 Compile TypeScript to GDScript for Godot
200 stars 14 forks source link

Converting const into var causes troubles for accessing within static method #99

Open namiwang opened 2 years ago

namiwang commented 2 years ago

source:

export const STATIC_VALUE = 1

export class FooClass extends Node {
  static static_func() {
    STATIC_VALUE
  }
}

transpiled:

# This file has been autogenerated by ts2gd. DO NOT EDIT!
extends Node
class_name FooClass 
var STATIC_VALUE: int = 1
static func static_func():
  STATIC_VALUE # <- ERROR: Can't access member variable ("STATIC_VALUE") from a static function.