Browse Source

Merge pull request #4654 from obiwan87/master

Minor adjustments in documentation-only files for better LSP support
Laytan 8 months ago
parent
commit
00afd53f46
2 changed files with 6 additions and 2 deletions
  1. 2 0
      base/builtin/builtin.odin
  2. 4 2
      base/intrinsics/intrinsics.odin

+ 2 - 0
base/builtin/builtin.odin

@@ -1,6 +1,8 @@
 // This is purely for documentation
 // This is purely for documentation
 package builtin
 package builtin
 
 
+import "base:runtime"
+
 nil   :: nil
 nil   :: nil
 false :: 0!=0
 false :: 0!=0
 true  :: 0==0
 true  :: 0==0

+ 4 - 2
base/intrinsics/intrinsics.odin

@@ -2,6 +2,8 @@
 #+build ignore
 #+build ignore
 package intrinsics
 package intrinsics
 
 
+import "base:runtime"
+
 // Package-Related
 // Package-Related
 is_package_imported :: proc(package_name: string) -> bool ---
 is_package_imported :: proc(package_name: string) -> bool ---
 
 
@@ -72,7 +74,7 @@ prefetch_write_instruction :: proc(address: rawptr, #const locality: i32 /* 0..=
 prefetch_write_data        :: proc(address: rawptr, #const locality: i32 /* 0..=3 */) ---
 prefetch_write_data        :: proc(address: rawptr, #const locality: i32 /* 0..=3 */) ---
 
 
 // Compiler Hints
 // Compiler Hints
-expect :: proc(val, expected_val: T) -> T ---
+expect :: proc(val, expected_val: $T) -> T ---
 
 
 // Linux and Darwin Only
 // Linux and Darwin Only
 syscall :: proc(id: uintptr, args: ..uintptr) -> uintptr ---
 syscall :: proc(id: uintptr, args: ..uintptr) -> uintptr ---
@@ -219,7 +221,7 @@ type_map_cell_info :: proc($T: typeid)           -> ^runtime.Map_Cell_Info ---
 type_convert_variants_to_pointers :: proc($T: typeid) -> typeid where type_is_union(T) ---
 type_convert_variants_to_pointers :: proc($T: typeid) -> typeid where type_is_union(T) ---
 type_merge :: proc($U, $V: typeid) -> typeid where type_is_union(U), type_is_union(V) ---
 type_merge :: proc($U, $V: typeid) -> typeid where type_is_union(U), type_is_union(V) ---
 
 
-type_has_shared_fields :: proc($U, $V: typeid) -> bool typeid where type_is_struct(U), type_is_struct(V) ---
+type_has_shared_fields :: proc($U, $V: typeid) -> bool where type_is_struct(U), type_is_struct(V) ---
 
 
 constant_utf16_cstring :: proc($literal: string) -> [^]u16 ---
 constant_utf16_cstring :: proc($literal: string) -> [^]u16 ---