Skip to content

Commit fea3ff3

Browse files
committed
minor fix
1 parent 4562fc9 commit fea3ff3

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

luisa_lang/hir.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,7 @@ class Function:
12771277
locals: List[Var]
12781278
complete: bool
12791279
is_method: bool
1280-
_inline_hint: bool | Literal['always', 'never']
1280+
inline_hint: bool | Literal['always', 'never']
12811281
returning_ref: bool
12821282

12831283
def __init__(
@@ -1296,11 +1296,12 @@ def __init__(
12961296
self.locals = []
12971297
self.complete = False
12981298
self.is_method = is_method
1299-
self._inline_hint = False
1299+
self.inline_hint = False
13001300
self.returning_ref = returning_ref
13011301

1302-
def inline_hint(self) -> bool | Literal['always', 'never']:
1303-
return self._inline_hint
1302+
1303+
1304+
13041305

13051306

13061307
def match_template_args(

luisa_lang/lang_builtins.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def range(start: T, end: T) -> List[T]: ...
135135
def range(start: T, end: T, step: T) -> List[T]: ...
136136

137137

138-
def range(*args):
138+
def range(*args, **kwargs): # type: ignore
139139
raise NotImplementedError(
140140
"range should not be called in host-side Python code. ")
141141

@@ -308,7 +308,7 @@ def write(self, value: T) -> None:
308308

309309
def __add__(self, offset: i32 | i64 | u32 | u64) -> 'Pointer[T]':
310310
return intrinsic("pointer.add", Pointer[T], self, offset)
311-
311+
312312
def __sub__(self, offset: i32 | i64 | u32 | u64) -> 'Pointer[T]':
313313
return intrinsic("pointer.sub", Pointer[T], self, offset)
314314

luisa_lang/utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ def from_ast(ast: ast.AST) -> Optional["Span"]:
9595
return None
9696
if not hasattr(ast, "col_offset"):
9797
return None
98-
if not hasattr(ast, "end_lineno") or ast.end_lineno is None:
98+
if not hasattr(ast, "end_lineno") or getattr(ast, "end_lineno") is None:
9999
return None
100-
if not hasattr(ast, "end_col_offset") or ast.end_col_offset is None:
100+
if not hasattr(ast, "end_col_offset") or getattr(ast, "end_col_offset") is None:
101101
return None
102102
file = None
103103
if hasattr(ast, "source_file"):

0 commit comments

Comments
 (0)